Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are developing a site and trying to translate the 'add to cart' button but cannot find the relevant code in functions.php, despite following documentation.
Solution:
If you're experiencing this issue, we recommend checking our documentation on string registration to make the strings available for translation in the UI. Here are some useful links:

Please note that the solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML Support Forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Lucas Vidal de Andrade 3 weeks, 1 day ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
August 30, 2024 at 10:44 am #16124296

basv-41

Background of the issue:
I am developing a site and trying to translate the 'add to cart' button. We use code in functions.php for the text for the add to cart button. I can't seem to find it. We are following the documentation at https://woocommerce.com/document/change-add-to-cart-button-text/ and https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/.

Symptoms:
I can't find the code in functions.php for the 'add to cart' button text.

Questions:
How can I translate the 'add to cart' button using WPML?
Where can I find the code in functions.php for the 'add to cart' button text?

August 30, 2024 at 12:57 pm #16124845

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hey there,

Unfortunately the customization and/or creation of custom code is outside the scope of this Forum. As the technical support forum, we help customers with default WPML functionalities, which is not the case here.

Nonetheless, I'd recommend you to check our documentation on string registration, so that they're available for translation inside the UI:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

Check the hooks that enable string registration. Here are other links that might be helpful:

https://wpml.org/documentation/support/translating-the-theme-you-created/

https://wpml.org/wpml-hook/wpml_register_single_string/

https://wpml.org/wpml-hook/wpml_register_string/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.