Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Balakrishnan-flycart/7b521ae28980fb676e49dcabdbdaf018 to your computer and use it in GitHub Desktop.
Save Balakrishnan-flycart/7b521ae28980fb676e49dcabdbdaf018 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - set discount price conversion
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