WordPress at Your Fingertips
function is not described

WC_Legacy_Cart::add_discount() public WC 1.0

Renamed for consistency.

{} It's a method of the class: WC_Legacy_Cart{}

No Hooks.


true|false True. if the coupon is applied, false if it does not exist or cannot be applied.


$WC_Legacy_Cart = new WC_Legacy_Cart();
$WC_Legacy_Cart->add_discount( $coupon_code );
$coupon_code(string) (required)

Code of WC_Legacy_Cart::add_discount() WC 5.7.1

public function add_discount( $coupon_code ) {
	return $this->apply_coupon( $coupon_code );