Skip Navigation

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

Problem:
The client is using the WPML plugin to translate a custom field within an email template managed by the Decorator plugin by Webtoffee. The email includes a custom

<a href>

tag for a shipping link, intended to be translated into German. However, the translation of the href link inside the custom field does not update live, despite attempts to unregister and re-register the string.
Solution:
We recommend the following steps to resolve the issue:
1. Add the following code to the functions.php file:

$option_key = 'rp_decorator_customer_completed_order_body';<br />add_filter( 'option_' . $option_key, [ wpml_st_load_admin_texts(), 'icl_st_translate_admin_string' ] );

2. Ensure that the string is translated in String Translation.
3. Create a test order in German to check the issue.

We have applied these steps to a sandbox site, and the string translated correctly. Please check if the string works as expected on your site.

If this solution does not resolve your issue or seems outdated, 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 problem persists, please open a new support ticket.

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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Osama Mersal 7 months ago.

Assisted by: Osama Mersal.

Author Posts
May 23, 2024 at 9:54 am #15661849

claudiuM-3

<b>Background of the issue: </b>
I am using the WPML plugin to translate a custom field within an email template managed by the Decorator plugin by Webtoffee. The email is intended to be translated into German, and includes a custom a href tag for a shipping link.

the original string has inside the following:

"Hi {customer_first_name},

We have finished processing your order and it is now shipped.

<a href="{_shipping_link}" style="font-size:20px"><b>Track Your Order and View Shipping Info<b /></a>

_

In the meantime, here is a reminder of what you ordered:"

<b>Symptoms: </b>
The translation of the href link inside the custom field does not update live, despite attempts to unregister and re-register the string, which worked for other strings but not for this one with the href tag.

<b>Questions: </b>
Why isn't the translation of the href link updating live when using WPML with the Decorator plugin?
What steps can I take to ensure the href link in the custom field updates live when translated?

May 23, 2024 at 12:16 pm #15662798

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) Please log in to this sandbox site and install the "Decorator plugin" plugin. (hidden link)

After that, please try to replicate the issue. If it is replicable, please let me know how to reproduce it so I can consult our compatibility team.

Note: you can check the emails using the Mail Log plugin.

2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. 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 /* That's all, stop editing! Happy publishing. */ line:

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

Best regards,
Osama

May 23, 2024 at 12:57 pm #15663047

claudiuM-3

Done,

I've added also Woocommerce + SMTP so I can receive emails

The string it's sent only on the Complete email so if you wanna test it you need to create a user with your email and then update the existing order and add yourself as the customer -> change the order from Processing to Complete and hit Update, after that you should receive an email and the email will be English, not German.. It needs to be german or at least if you could find the solution for the href tag.

May 23, 2024 at 2:00 pm #15663679

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for replicating the issue. I consulted our compatibility team, and I'll update you as soon as I get their reply.

Best regards,
Osama

May 24, 2024 at 11:08 am #15667355

claudiuM-3

Hi Osama, do you have any updates?

Thank you!

May 24, 2024 at 11:20 am #15667388

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I don't have an update yet, and it might take some time due to the workload and the weekend.

Thanks for your patience.

Best regards,
Osama

May 28, 2024 at 12:47 pm #15678524

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your patience. Please check the following steps:

1- Add the following code to the functions.php file

$option_key = 'rp_decorator_customer_completed_order_body';
add_filter( 'option_' . $option_key, [ wpml_st_load_admin_texts(), 'icl_st_translate_admin_string' ] );

2- Make sure that the string is translated in String Translation
3- Create a test order in German to check the issue

I've applied the above steps to the sandbox site, and the string is translated correctly. Please check it and let me know if the string works as expected.

Best regards,
Osama

May 28, 2024 at 12:51 pm #15678527

claudiuM-3

Thank you, it actually works well! Crazy how such a short code can fix such a big issue haha.

Thanks again!