WC_Coupon::set_minimum_amount │ public │ WC 3.0.0

Set the minimum spend amount.

Method of the class: WC_Coupon{}

No Hooks.

Returns

void. Nothing (null).

Usage

$WC_Coupon = new WC_Coupon();
$WC_Coupon->set_minimum_amount( $amount );
$amount(float|string) (required)
Minimum amount.

Changelog

Since 3.0.0 Introduced.

WC_Coupon::set_minimum_amount() code WC 11.3.0

public function set_minimum_amount( $amount ) {
	$amount = wc_format_decimal( $amount );
	if ( (float) $this->get_maximum_amount() && (float) $amount > (float) $this->get_maximum_amount() ) {
		$this->error( 'coupon_invalid_minimum_amount', __( 'Invalid minimum spend value.', 'woocommerce' ) );
	}
	$this->set_prop( 'minimum_amount', $amount );
}