I would like to replace the dash ( - ) by aslash ( / ) on WooCommerce product price range.
So the displayed price range must be, for example $100 / $200 instead of $100 - $200
Here is a screenshot of what I mean.
I would like to replace the dash ( - ) by aslash ( / ) on WooCommerce product price range.
So the displayed price range must be, for example $100 / $200 instead of $100 - $200
Here is a screenshot of what I mean.
Using str_replace() function in woocommerce_format_price_range filter hook, will replace the dash by a slash for WooCommerce product prices range:
add_filter( 'woocommerce_format_price_range', 'custom_format_price_range', 10, 3 );
function custom_format_price_range( $price ) {
$price = str_replace('–', '/', $price);
return $price;
}
Code goes in function.php file of your active child theme (or active theme). Tested and works.