Skip to content Skip to sidebar

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

Problem:
The client needs to set up WooCommerce confirmation emails to be sent in Croatian when a user makes an order on the Croatian version of their website.

Solution:
First, we asked the client to clarify if they had directly changed the email template in WooCommerce or added a customization in their theme's functions.php file.

We then suggested that the client make the necessary changes and scan their theme for strings by going to WPML → Theme and plugins localization, selecting their theme, and scanning it.

We also provided the client with a link to the section in our WooCommerce documentation dedicated to translating custom-coded WooCommerce emails.

If this solution does not seem relevant, we encourage the client to open a new support ticket for further assistance: Contact WPML Support.

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.

This topic contains 5 replies, has 2 voices.

Last updated by Marsel Nikolli 1 year, 11 months ago.

Assisted by: Marsel Nikolli.

Author Posts
January 5, 2024 at 10:04 am #15153778

martinK-156

Hi,

The default language of the site rerunit.eu is English and the secondary is Croatian. I setup the WooCommerce confirmation emails, but I want to set it up in a way that when a user is visiting the Croatian version of the website and makes an order - the confirmation emails they receive are in Croatian and not English.

How to translate WooCommerce confirmation emails with WPML?

I tried playing around with FAQ solutions on WPML website such as adding the "<p><?php printf( _e( 'CUSTOM TEXT', 'woocommerce' ); ?></p>" line of code in .PHP file but that crashed my website, so I don't want to play around anymore and do more damage.

Thanks

January 5, 2024 at 10:49 am #15154036

Marsel Nikolli

Hi,



Thank you for contacting WPML Support, I will be happy to help you.


In order to translate the WooCommerce email templates I suggest you check our documentation related in this link:
https://wpml.org/documentation/related-projects/woocommerce-multilingual/how-to-translate-woocommerce-emails/

Let me know if that works out for you.

Regards,
Marsel

January 5, 2024 at 10:54 am #15154048

martinK-156

As I already wrote; I checked that documentation but did not manage to figure it out. I'm using custom-coded PHP emails because I changed some lines from the default templates.

January 5, 2024 at 11:25 am #15154119

Marsel Nikolli

Can you please explain a bit about this customization? I mean did you directly change the email template in WooCommerce or added a customization in your theme's functions.php (or another) file?

Usually this is how these emails are customized and translated (after scanning your theme): https://wpml.org/documentation/related-projects/woocommerce-multilingual/how-to-translate-woocommerce-emails/#translating-custom-coded-woocommerce-emails

* Please note: To be able to achieve what you need it might require custom coding which is beyond the scope of this support forum, in such case we recommend that you check our contractors' page: https://wpml.org/contractors/.

Thank you for understanding and looking forward to your reply.

Regards,
Marsel

January 5, 2024 at 12:23 pm #15154339

martinK-156

I edited the emails by going to Theme File Editor as shown in the screenshot. Does this help clarify things?

Capture-2024-01-05-132204.png
January 5, 2024 at 12:49 pm #15154443

Marsel Nikolli

Thanks for the update.

Can you try making the changes you need and then, scan your theme for the strings by going to WPML → Theme and plugins localization? Select your theme and scan it.

As shown here: https://wpml.org/documentation/related-projects/woocommerce-multilingual/how-to-translate-woocommerce-emails/#translating-custom-coded-woocommerce-emails:~:text=Then%2C%20scan%20your%20theme%20for%20the%20strings%20by%20going%20to%20WPML%20%E2%86%92%20Theme%20and%20plugins%20localization.%20Select%20your%20theme%20and%20scan%20it.

* You said that your website crashed before, did you get any error message or any notification related?

-------

It might not be related but according to your debug.info, the WP memory limit needs to be increased, WordPress uses 40Mb as default and the minimum requirements for WPML are 128 MB. (Kindly check this page: https://wpml.org/home/minimum-requirements/)

You can increase it by adding the following code in your wp-config.php file right before the line: /* That's all, stop editing! Happy publishing. */

/* Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M');

Looking forward to your reply.