Skip Navigation

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 6 replies, has 2 voices.

Last updated by olgaB-3 1 year, 11 months ago.

Assisted by: Yvette.

Author Posts
May 5, 2022 at 3:52 pm #11161287

olgaB-3

Tell us what you are trying to do?

We are using WooCommerce Custom Fields from RightPress
hidden link

The new order notification emails have to include custom fields no matter in what language the client checked out hidden link

Issue:

We have 2 admin emails for the woocommerce new orders.

If the customer checks out in English the first email recipient will see the custom fields properly but the second email recipient WON'T see them.

If the customer checks out in French the first email recipient WON'T see the custom fields properly but the second email recipient WILL see them.

What is the link to your site? We debug the issue on staging hidden link

Note*
All the fields are properly translated.

May 6, 2022 at 10:13 am #11166267

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello

I will be helping you.

Questions.

1. Do the fields function the way you want while purchasing? Is the only issue the moment they appear on the email?

2. Which plugin are you using to create the emails?

3. Can you replicate this issue here?
hidden link

Please make the most simple case possible and only upload plugins that are absolutely necessary to create the field and the emails as you have it on your site.

Thanks

May 6, 2022 at 4:40 pm #11170255

olgaB-3

Questions.

1. Do the fields function the way you want while purchasing? Is the only issue the moment they appear on the email?

Yes, the purchasing and check-out work great. The only issue is with New Order email notifications.

2. Which plugin are you using to create the emails?

Kadence WooCommerce Email Designer. I installed it already on the demo install you provided.

We use WooCommerce Custom Fields for the custom check out fields and I also installed this plugin on the demo.

3. Can you replicate this issue here?
hidden link

Yes, I replicated the issue.

You will see that I placed 2 orders.
1 order via Englsih checkout page order#119
2 order via Spanish checkout page order #126

Now you can go to email customize and see how the notifications look like.

The checkout fields in "New Order" are visible based on the WP language dashboard language.

If you are in English WP dashboard you will see checkout fields only for the order that was checkout from the Englsih checkout page, but to see the Spanish custom fields you will have to change the admin language WP dashboard to Spanish. See watched.

We want to receive the New Order notification and see the custom fields.

*****

I found the same issue on your forum, but the code that you provided on that thread doesn't fix my issue.

They wanted New Order and Processing Order e-mails (to admin and user respectively) to arrive in the same language that which customer is using.

https://wpml.org/forums/topic/sending-woocommerce-new-order-e-mail-in-user-language/

Thank you for your help,
Olga

checkout fields.png
May 6, 2022 at 5:27 pm #11170397

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Thanks.

So if I understand correctly, your issue is that you would like the Checkout Fields to be treated as if they were not language dependent?

1. Is that right?

2. Have you thought of not setting the checkout fields to be translatable?

3. I am not sure this is a WPML issue. If the fields are language dependent, then either the order language or the admin language will be used to select the fields during the time of email creation. This logic can be changed, of course, but it is not within WPML where this selection happens but in the email plugin itself.

Have you appraoched the email plugin authors about what you want?

My apologies if I have misunderstood the issue at hand.

May 6, 2022 at 6:02 pm #11170485

olgaB-3

Hello,

So if I understand correctly, your issue is that you would like the Checkout Fields to be treated as if they were not language-dependent?

1. Is that right? Yes, We want to get "New Order" notifications no matter the language check out.

2. Have you thought of not setting the checkout fields to be translatable?

We have to translate them because we can't have English text for a French audience.

3. No we didn't approach the email plugin.

Did you have time to look into the support thread I provided you?

We also want the same. I would like New Order and Processing Order e-mails (to admin and user respectively) to arrive in the same language that which customer is using.
Is it possible?

A few years ago WPML support provided with this code, I used it but It doesn't work on my installation.
https://wpml.org/forums/topic/sending-woocommerce-new-order-e-mail-in-user-language/

thank you,
Olga

May 9, 2022 at 9:15 am #11179097

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello Olga,

Yes I read through that thread and the answer remains the same. Woocommerce is generating the emails and using the admin language in the background the select fields for viewing on the Order Dashboard screen as well as for creating the adming emails.

The admin languages is influenced by the user profile.

As you want to treat the custom field as translatable (for the labels) you will need to approach the Woocommerce Custom Field plugin author about how to modify their logic when selecting fields as this is not within our control. We do not touch code that is not written by our own programmers.

I include a screenshot of call in the plugin code where it is evident that the field selection is within the plugin in question.

While our plugin is compatible with the plugin, what you want to do is a bit out of the normal use case: have custom fields be seen in all languages (non-translatable) yet be treated on output as translatable.

If this can be done, it will have to be a modification to the logic that is selecting the fields to both print on the admin. metabox as well as on the email template.

Editar plugins _ Sandbox — WordPress.png
May 10, 2022 at 4:00 pm #11191353

olgaB-3

Thank you!

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