Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AshlinRejo/3d6a972e339e156dd2b236a8bb51ffb0 to your computer and use it in GitHub Desktop.
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
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);
@AshlinRejo
Copy link
Author

This included in plugin from v2.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment