Translate specific part of the Woocommerce template

Asked

Viewed 2,507 times

0

Hello.. I can’t find the file to translate the text "Product successfully Added to your Cart." Along with the button "Continue Shopping".

ps.: I’ve tried opening several language files in poedit but still failed.

3 answers

1

Va no woocommerce-functions.php and look for the function that contains the property 'woocommerce_add_to_cart_message' to change the message "Product successfully Added to your Cart."

For the message on the button look for the function my_cart_messages in that same file.

  • 1

    Never, ever, in any way edit a plugin directly, otherwise you will lose the modification whenever it is updated or worse, will stay without updating and probably running the security risk, which already several security fixes being always being made.

  • Thanks for the tip @Claudiosanches!

  • In which directory is this @DHEKU file ?

  • And how should it be done not to edit directly then @Claudiosanches ?

1

Upgrade your Woocommerce from version 2.3.5 to 2.3.7 which is the latest version. It will probably show the warning to update the translation too, if it does not appear, go to Woocommerce > System Status > Tools and click the button Force Translation Update.
This latest version of Woocommerce is 100% translated to Brazilian Portuguese. In addition it has 99% of the frontend translated to Portuguese from Portugal.

This way it has to work.

However, if it is not working yet, it may be being changed by some plugin or its theme. In this case recommend you try to translate with the plugin Codestyling Localization.

  • Puts didn’t work with the forced update @Claudiosanches. And I installed this plugin but it just promises to save the translations made, I did not find a way to translate any specific part. In the Ecommerce plugin it is giving the following message.. Warning: printf() [Function.printf]: Argument number must be Greater than zero in /home/wanderci/public_html/Ecommerce/wp-admin/includes/update.php on line 289 Not giving this way update. Can you tell me how to fix it? Thank you!

0

I managed to find the file to edit these texts! Follow the path..

/wp-content/themes/seutema/includes/theme_woocommerce.php

Browser other questions tagged

You are not signed in. Login or sign up in order to post.