| @@ -25,9 +25,12 @@ | ||
| 25 | 25 | * @param string $coupon_code Coupon code. |
| 26 | 26 | * @return float |
| 27 | 27 | */ |
| 28 | 28 | function disco_disable_coupon_application( $valid, $coupon, $discount ) { |
| 29 | - if ( Settings::get( 'discount_priority_type' ) === 'both' ) { | |
| 29 | + if( | |
| 30 | + Settings::get( 'discount_priority_type' ) === 'woocommerce_coupon' || | |
| 31 | + Settings::get( 'discount_priority_type' ) === 'both' | |
| 32 | + ) { | |
| 30 | 33 | return $valid; // Allow coupon validation if the setting is enabled. |
| 31 | 34 | } |
| 32 | 35 | return false; // This will prevent all coupons from being valid |
| 33 | 36 | } |