• Resolved paulcoppock

    (@paulcoppock)


    I created a child theme for a wootheme using the woocommerce plugin. I I need to change the price label of “From” for the variable products.

    I found this in several postings about changing the “From” label:

    add_filter(‘woocommerce_variable_price_html’,’custom_from’,10);
    add_filter(‘woocommerce_grouped_price_html’,’custom_from’,10);
    add_filter(‘woocommerce_variable_sale_price_html’,’custom_from’,10);

    function custom_from($price){
    $new_from = “THE-NEW-LABEL-HERE”;
    $price = str_replace(‘From’,$new_from,$price);
    return $price;
    }

    AddING this code to a newly created functions.php file for the child theme does not work. I’m guessing it’s because the functions.php file is loaded prior to the parent themes’ functions.php file.

    I’ve search all of the woocommerce template files looking for the “From” prefix label so I can change it to “Desde” which is what I want it to say rather than “From”. For some reason right now the word “From” is being translated to “De” but should be “Desde”.

    Does anyone know how to edit and which file(s) to edit to make this change. Any help with this is greatly appreciate.

    Paul

    https://www.ads-software.com/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • i have the same problem, adding the filters i can get the ”from” to desapear. what i would like to do is, to change ”from” to pvp iva incluido, i tryed to change it on the language .po but it didnt work… paulcoppock u can try to change it on woocommerce/i18/languages and than in language ES .po (sth like that) if u make a search for ”from” u can get to desde and make the translation u want.. but for me it didnt work…

    Thread Starter paulcoppock

    (@paulcoppock)

    Thanks Elsonce,

    I ended up just editing the template file and changing the From to Desde. I know it’s bot the best way because when woocommerce is updated I’ll lose that change.

    Using a child theme made it even more difficult to find a solution.

    Thread Starter paulcoppock

    (@paulcoppock)

    Thanks

    hi Paulcoppock can u send me the ”template” file location where u changed the ”from”? ill try to change it from there

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The Variable Price Prefix Label "From": How to chage it?’ is closed to new replies.