• Simple change I can’t find…

    How can I change the “-” to “or” on the product prices?
    I am fairly familiar with code editing, I just can’t find that.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there
    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;
    }

    Look for the woocommerce template that creates the price phrase. It has a span element with a class of “price”. Most likely it will be in your theme somewhere, but could be in the woo plugin itself. To change it you need to create a child theme, copy the template file and customise it.
    As an alternative to customising the template, you may find that there is a filter available.
    Looks like someone beat me to it while I was writing my reply. Such is life.

    • This reply was modified 3 years, 10 months ago by RossMitchell.
    Thread Starter andrewm57

    (@andrewm57)

    @iambherulal Perfect, thanx! Except that the emailed version was HTML entity encoded ??

    • This reply was modified 3 years, 10 months ago by andrewm57.
    • This reply was modified 3 years, 10 months ago by andrewm57.
    • This reply was modified 3 years, 10 months ago by andrewm57.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Simple text change on price range’ is closed to new replies.