Change priority of variable strikeout and display only minimum price
Adjust priority of variable strikeout and display only the minimum price.
add_action('advanced_woo_discount_rules_after_initialize', function() {
if(class_exists('\Wdr\App\Router')){
remove_filter('woocommerce_variable_price_html', array(\Wdr\App\Router::$manage_discount, 'getVariablePriceHtml'), 100);
add_filter('woocommerce_variable_price_html', array(\Wdr\App\Router::$manage_discount, 'getVariablePriceHtml'), 10000, 2);
}
});
add_filter('advanced_woo_discount_rules_strikeout_price_html', function($html, $original_price, $discounted_price, $is_variable_product){
if($is_variable_product){
return "Fr: " .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);