Created
November 10, 2021 13:29
-
-
Save AshlinRejo/80460890f322adf5ee88f1a9dcc84a20 to your computer and use it in GitHub Desktop.
Discount rules v2: Display only minimum price
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_strikeout_price_html', function($html, $original_price, $discounted_price, $is_variable_product){ | |
if($is_variable_product){ | |
return "From: " .str_replace("<br>", ' ', $html); | |
} else { | |
return $html; | |
} | |
}, 10, 4); | |
add_filter('advanced_woo_discount_rules_format_sale_price_range', function($html, $min_price, $max_price, $original_html){ | |
return wc_price($min_price); | |
}, 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment