Last active
May 3, 2021 15:49
-
-
Save Balakrishnan-flycart/7b521ae28980fb676e49dcabdbdaf018 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - set discount price conversion
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_select_set_discount_type', function($static_type, $discount_type){ | |
| return $discount_type; | |
| }, 10, 2); | |
| add_filter('advanced_woo_discount_rules_calculate_current_discount_amount', function($current_discount_amount, $price_discount){ | |
| if($price_discount['discount_type'] == 'fixed_set_price' && isset($price_discount['discount_price']) && !empty($price_discount['discount_price'])){ | |
| return $price_discount['discount_price']; | |
| } | |
| return $current_discount_amount; | |
| }, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment