Created
May 14, 2021 11:16
-
-
Save Balakrishnan-flycart/73791609ffdca3f7088d643533a83333 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - disable discount rules(coupon will work)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('advanced_woo_discount_rules_run_discount_rules', function($run_rule, $cart_object){ | |
| if (class_exists('\Wdr\App\Helpers\Woocommerce')) { | |
| $applied_coupons = \Wdr\App\Helpers\Woocommerce::getAppliedCoupons(); | |
| $coupons_list = array('coupon1', 'coupon2'); // enter your coupon instead of "coupon1, coupon2" | |
| if (count(array_intersect($coupons_list, $applied_coupons)) > 0){ | |
| return false; | |
| } | |
| } | |
| return $run_rule; | |
| }, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment