WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] The Variable Price Prefix Label "From": How to chage it? (5 posts)

  1. paulcoppock
    Member
    Posted 11 months ago #

    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

    http://wordpress.org/plugins/woocommerce/

  2. elsonce
    Member
    Posted 11 months ago #

    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...

  3. paulcoppock
    Member
    Posted 11 months ago #

    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.

  4. paulcoppock
    Member
    Posted 11 months ago #

    Thanks

  5. elsonce
    Member
    Posted 11 months ago #

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

    Thank you!

Reply

You must log in to post.

About this Plugin

About this Topic