Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions includes/class-wc-brands-coupons.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down