Created
December 18, 2019 13:02
-
-
Save AshlinRejo/23da9a87e64579e42a85689b49842a8d to your computer and use it in GitHub Desktop.
Discount rules: Round the subtotal before apply discount in cart for cart rules
This file contains 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
function woo_discount_rules_before_calculate_discount_from_subtotal_in_cart_method($subtotal, $discount_type){ | |
if(function_exists('wc_round_discount')){ | |
$subtotal = wc_round_discount($subtotal, 0); | |
} | |
return $subtotal; | |
} | |
add_filter('woo_discount_rules_before_calculate_discount_from_subtotal_in_cart', 'woo_discount_rules_before_calculate_discount_from_subtotal_in_cart_method', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment