• Resolved smarta-brett

    (@smarta-brett)


    I have the code shown below in my child theme functions file

    this puts the word “From” before the price

    however this site is using Catalog mode and some of the products do not have prices – yet the “from” still appears

    I would like to qualify the “From” prefix so that it only show up when a price is displayed – is this possible?

    here is the current code

    function change_product_price_html($price){

    $newPrice = “From “;
    $newPrice .= $price;
    $newPrice .= “”;

    return $newPrice;
    }

    add_filter(‘woocommerce_get_price_html’, ‘change_product_price_html’);

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Prefix Price (but only show when price is displayed)’ is closed to new replies.