diff --git a/includes/class-wc-brands-coupons.php b/includes/class-wc-brands-coupons.php index 9ed908d..1090a83 100644 --- a/includes/class-wc-brands-coupons.php +++ b/includes/class-wc-brands-coupons.php @@ -33,6 +33,10 @@ public function __construct() { * @return bool $valid True if coupon is valid, otherwise Exception will be thrown */ public function is_coupon_valid( $valid, $coupon, $discounts = null ) { + if (WC()->cart == null) { + return $valid; + } + $this->set_brand_settings_on_coupon( $coupon ); // Only check if coupon still valid and the coupon has brand restrictions on it.