WordPress at Your Fingertips
function is not described

WC_Cart::check_cart_coupons() public WC 1.0

Check cart coupons for errors.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->check_cart_coupons();

Code of WC_Cart::check_cart_coupons() WC 5.6.0

public function check_cart_coupons() {
	foreach ( $this->get_applied_coupons() as $code ) {
		$coupon = new WC_Coupon( $code );

		if ( ! $coupon->is_valid() ) {
			$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_INVALID_REMOVED );
			$this->remove_coupon( $code );
		}
	}
}