Skip Navigation

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

Problem:
The client is experiencing an issue where the WooCommerce Gift Cards plugin sends notification emails in Greek regardless of the site language from which the gift card was purchased. Previously, a snippet was used to solve this, but it now causes a fatal error.
Solution:
We recommended updating the functions.php file with the following code:

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

Additionally, we advised adding the following XML configuration to the WPML-> Settings-> Custom XML tab to ensure proper translation management:

<wpml-config>
  <admin-texts>
    <key name="woocommerce_gift_card_received_settings">
      <key name="subject"></key>
      <key name="heading"></key>
      <key name="intro_content"></key>
      <key name="additional_content"></key>
    </key>
  </admin-texts>
</wpml-config>

We asked the client to verify if the last email is translated correctly by checking their WPML plugin log.

Please note that this solution might be outdated or not applicable to your specific case. If this solution does not resolve your issue, we highly recommend checking related 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 27 replies, has 2 voices.

Last updated by Osama Mersal 4 months, 3 weeks ago.

Assisted by: Osama Mersal.

Author Posts
July 9, 2024 at 8:56 am #15919152

nikolaosM

Hello Osama,

Email subject and footer was translated, but the email content was not hidden link.

July 9, 2024 at 9:03 am #15919214

Osama Mersal
Supporter

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

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

Hi,

I updated the body string translation. After that, I placed a new order. (Kindly check the attached screenshot)

Best regards,
Osama

2024-07-09_12-02-36.jpg
July 9, 2024 at 9:06 am #15919297

nikolaosM

It looks like it is working. Let me check it on our site and I will come back to you.

July 9, 2024 at 9:17 am #15919385

Osama Mersal
Supporter

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

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

Hi,

Sure, please take your time and let me know if the steps worked on your site.

Best regards,
Osama

July 9, 2024 at 12:21 pm #15920763

nikolaosM

Hello Osama,

The snippet is no more causing problems in our site. Almost al the strings appear corectly. I have made a test order in the live site and this strings are showen in Greek where the gift card is from the English site. hidden link. This strings are prodused by the plugin and not in the woocommerce email settings.

Thanks!

July 9, 2024 at 12:26 pm #15920779

Osama Mersal
Supporter

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

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

Hi,

Please scan the plugin via WPML-> Theme and Plugin Localization. Then, go to String Translation, search for these strings, and make sure that they are translated correctly.

Best regards,
Osama

2024-07-09_15-25-21.jpg
July 10, 2024 at 7:39 am #15926233

nikolaosM

Hello,

I translated the strings from english to greek, but in your sandbox I was not able to recreate my issue. In the live site all this strings appear in greek, even if I have made the order from the greek or the english site.

Thanks!

July 10, 2024 at 8:31 am #15926530

Osama Mersal
Supporter

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

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

Hi,

I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

July 10, 2024 at 9:59 am #15927332

nikolaosM

Hello Osama,

I can provide you with demo site credentials, but you sould only take a copy of the site to debug localy since we are facing problems with elementor too in this site and we have given access to them to make changes so you may conflict with them. Are you ok with that? If so please activate hidden message again.

Thanks!

July 10, 2024 at 10:03 am #15927367

Osama Mersal
Supporter

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

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

Hi,

Yes, no problem. There is one more test you can run on your site before sharing the access details:

Following these steps, please check if the issue persists in a minimal environment.

1- Deactivate all the plugins except those active ones on the sandbox site.
2- Switch to a WordPress default theme like Twenty Twenty-one.
3- Delete one of the problematic strings, for example, the Amount string.
4- Scan the plugin via WPML-> Theme and Plugin Localization
5- Translate the string
6- Clear the site's cache
7- Place an order

If the issue is gone, activate them one by one to see which one is causing an interaction issue.

❌ Please backup your database before performing the above test ❌

Best regards,
Osama

July 10, 2024 at 12:55 pm #15928168

Osama Mersal
Supporter

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

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

Hi,

Thanks for the access details. I installed a local copy of your site, and the strings worked correctly after the following steps:

1- Deactivate all plugins except the sandbox hidden link">ones
2- Update all active plugins to the latest version
3- Activate the WordPress default theme
4- Add the code hidden link">snippet
5- Place an hidden link">order in English

After fixing the Elementor issue, please try the above steps and let us know if the strings work correctly.

If they work correctly, activate the plugins one by one to see which one is causing an interaction issue.

The current issue could be caused by the old versions you use, so please make sure to use the latest versions of the plugins.

Best regards,
Osama

July 10, 2024 at 1:44 pm #15928392

nikolaosM

Hello Osame,

Did you also update woocomemrce?

July 10, 2024 at 1:45 pm #15928397

Osama Mersal
Supporter

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

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

Hi,

Yes, I updated WooCommerce along with WPML plugins.

Best regards,