Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshlinRejo/20f6cf46c67a9932c78c7136c65cf062 to your computer and use it in GitHub Desktop.
Save AshlinRejo/20f6cf46c67a9932c78c7136c65cf062 to your computer and use it in GitHub Desktop.
Woo Discount Rules: If some plugin override the price
if(!function_exists('woo_discount_rules_remove_event_woocommerce_before_calculate_totals_method')){
function woo_discount_rules_remove_event_woocommerce_before_calculate_totals_method($remove_event){
return true;
}
}
add_filter('woo_discount_rules_remove_event_woocommerce_before_calculate_totals', 'woo_discount_rules_remove_event_woocommerce_before_calculate_totals_method');
if(!function_exists('woo_discount_rules_has_price_override_method')){
function woo_discount_rules_has_price_override_method($hasPriceOverride, $product){
return true;
}
}
add_filter('woo_discount_rules_has_price_override', 'woo_discount_rules_has_price_override_method', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment