WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

CartCouponSchema::coupon_exists() public WC 1.0

Check given coupon exists.

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

No Hooks.

Return

true|false.

Usage

$CartCouponSchema = new CartCouponSchema();
$CartCouponSchema->coupon_exists( $coupon_code );
$coupon_code(string) (required)
Coupon code.

Code of CartCouponSchema::coupon_exists() WC 5.6.0

public function coupon_exists( $coupon_code ) {
	$coupon = new \WC_Coupon( $coupon_code );
	return (bool) $coupon->get_id() || $coupon->get_virtual();
}