Skip Navigation

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

Problem:
The client is experiencing an issue where Dynamic Rules for hiding/showing content in Elementor and Anywhere Elementor Templates are not translating correctly after translating a French site into English. Specifically, flags next to product names are not appearing on the English version of the site.

Solution:
We recommend the following steps to resolve the issue:
1. Navigate to the

.../wp-content/plugins/anywhere-elementor-pro/includes/modules/dynamic-rules/module.php

file.
2. Locate line 723.
3. Replace the existing line of code:

$value = $rule['ae_rule_' . $key . '_' . $post_term_types . '_value'];

with the following code:

$value = $rule['ae_rule_' . $key . '_' . $post_term_types . '_value'];<br />foreach ($value as $wpml_tag_id) {<br />$wpml_translated_ids[] = apply_filters('wpml_object_id', $wpml_tag_id, 'product_tag');<br />}<br />$value = $wpml_translated_ids;

After making these changes, please check the templates on the front end to see if the issue is resolved.

If this solution does not seem relevant to your situation, please open a new support ticket with us.

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 21 replies, has 3 voices.

Last updated by Andrés 1 year, 3 months ago.

Assisted by: Osama Mersal.

Author Posts
January 8, 2024 at 9:08 am #15159012

Osama Mersal
WPML Supporter since 02/2020

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

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

Hi,

Thanks for your update. Please let me know how it's not working on the sandbox site to update our compatibility team. Please check the following:

Tag 1: hidden link
Tag 2: hidden link
Clothing category: hidden link

Best regards,
Osama

January 16, 2024 at 2:20 pm #15190567

andreS-25

Hi.

Issue still hasn't been solved. I am a co worker of Andre, since he is gone for 3 weeks I am taking this case as well.

The tags aren't changing in the sandbox.

January 16, 2024 at 3:48 pm #15191012

Osama Mersal
WPML Supporter since 02/2020

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

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

Hi,

Please login to this sandbox site. (hidden link)

I checked the tags, and they work correctly in both languages. Kindly check the following:

Tag 1: hidden link
Tag 2: hidden link

Please let me know if it's not working correctly.

Best regards,
Osama

January 16, 2024 at 5:51 pm #15191600

andreS-25

Yes it seems to work fine.

How do I implement this in my website now ?

January 17, 2024 at 8:21 am #15193286

Osama Mersal
WPML Supporter since 02/2020

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

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

Hi,

Please apply the steps mentioned in this reply. (https://wpml.org/forums/topic/anywhere-elementor-dynamic-rules-not-translating/#post-15156651)

Best regards,
Osama

January 24, 2024 at 7:33 pm #15223573

andreS-25

Hi Osama,

I'm having a hard time replacing the code. Could you provide me some steps on how to do so, with which code the change.

Thank you so much !

Ioan

January 25, 2024 at 9:50 am #15225287

Osama Mersal
WPML Supporter since 02/2020

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

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

Hi Ioan,

Please check the following steps:

1- Edit the (/wp-content/plugins/anywhere-elementor-pro/includes/modules/dynamic-rules/module.php) file
2- Look for line 723 (Kindly check the attached screenshot)
3- Replace the following line

$value           = $rule[ 'ae_rule_' . $key . '_' . $post_term_types . '_value' ];

With

$value           = $rule[ 'ae_rule_' . $key . '_' . $post_term_types . '_value' ];
foreach ($value as $wpml_tag_id) {
$wpml_translated_ids[] = apply_filters('wpml_object_id', $wpml_tag_id, 'product_tag');
}
$value = $wpml_translated_ids;

After that, please check the templates on the front end.

Best regards,
Osama

2024-01-25_11-48-04.jpg