Created
August 29, 2022 08:00
-
-
Save AshlinRejo/3d6a972e339e156dd2b236a8bb51ffb0 to your computer and use it in GitHub Desktop.
Discount rule v2: Remove thirdparty coupon when free shipping rule is applied in cart
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_apply_free_shipping', function ($has_free_shipping){ | |
if(class_exists('\Wdr\App\Router')){ | |
$manage_discount = \Wdr\App\Router::$manage_discount; | |
add_action('woocommerce_after_calculate_totals', array($manage_discount, 'removeThirdPartyCoupon'), 20); | |
} | |
return $has_free_shipping; | |
}, 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This included in plugin from v2.5.0