WC_Coupon::set_maximum_amount
Set the maximum spend amount.
Method of the class: WC_Coupon{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Coupon = new WC_Coupon(); $WC_Coupon->set_maximum_amount( $amount );
- $amount(float|string) (required)
- Maximum amount.
Changelog
| Since 3.0.0 | Introduced. |
WC_Coupon::set_maximum_amount() WC Coupon::set maximum amount code WC 10.3.5
public function set_maximum_amount( $amount ) {
if ( (float) $amount && (float) $this->get_minimum_amount() > (float) $amount ) {
$this->error( 'coupon_invalid_maximum_amount', __( 'Invalid maximum spend value.', 'woocommerce' ) );
}
$this->set_prop( 'maximum_amount', wc_format_decimal( $amount ) );
}