SOLVED: WPML Translation: Popup interactivity gets lost

The connection to popups gets lost after translation, leading to non-functional buttons.

This is already described here: https://wpml.org/de/forums/topic/bricksbuilder-pop-up-trigger-click-not-working-on-translated-pages/
And here: WPML translated element's interactions doesn't work

It would be perfect if you can confirm this bug and give a rough estimate when a fix can be applied

1 Like

Hi Justin,
The problem was forwarded to us, as stated by the WPML colleague, so a task already exists.
I have added your report for the sake of completeness.

2 Likes

Hey @timmse , I’m facing the same issue. Is there any ETA for the resolution of the ticket?

Hi Ufuk,
Welcome to the forum!

Unfortunately, I can’t report anything new yet. The task is still on the to-do list and seems to be a tougher nut to crack :chipmunk:

Hey Stefan, thank you for your quick response. Do you know of any workaround? Maybe duplicating the Popup or similar?

No, unfortunately not :pensive:

Since we really need this solved, I would love if you guys could talk to us about the problematics. I would love to help:

One way I can come up with how this could potentially be solved:

  1. Hook into update_post or wpml_tm_save_translation_cf - WPML
  2. Check if post is using bricksbuilder
  3. Check if post is a translation by using wpml_object_id - WPML to get the defaults language element.
  4. Check if the post currently in scope, which at this point can be assumed to be translated is not using the “manual translation”, since users probably would like to have full control when duplicating and not using the translation editor
  5. Iterate over the content and check for elements with interactivity for popups. Whenever a popup is mentioned map the popup element id to the wordpress template post id in the source language.
  6. For each popup in source language try to get the translation like in step 3 and return the element id of the popup if found. Replace in content
  7. Done.

Since the popup template is already translatable, this should work if bricks provides functionality to get template post_id for an element_id.

@timmse anything new? I would really love to help you guys with this.

I found an easy solution. Just add this code to the Body (footer) scripts in bricks settings:
**Change the id’s of your form

(function($) {
$(document).ready(function() {
// Listener for opening the modal
$(“#brxe-jmenhk”).click(function() {
$(“div[data-popup-id=‘1674’]”).removeClass(‘hide’);
});

    // Listener for closing the modal
    $("#brxe-hifdan").click(function() {
        $("div[data-popup-id='1674']").addClass('hide');
    });
});

})(jQuery);

Hi @zah ,
i think this is more like a workaround and especially when working with a lot of popups this required a lot of manual work.

I think bricksbuilder should solve this natively :slight_smile:

1 Like

For sure they have to fix it, but for now, it is a fix for me :slight_smile:

I found that on the second language version, clicking the button does not remove the hide class.

I’m showing the modal with condition: on click add/hide CSS selector “.brx-popup”.

Yup you’re right. This is not expected behaviour :ok_hand:

I’m also having this issue :slight_smile:

I have interactions on 4 different pages and the weird thing is they’re working well on one page, but they don’t work on the other 3 pages. WPML seems to be problematic with Bricks’ advanced features.

Hey, also ended up with this element interaction reference getting lost issue. It was marked as duplicate, but issue described here DUPLICATE: Reference Syncing not working for Element interactions (with WPML translations)

Waiting patiently for a fix for this.

@timmse and @charaf this has been a pending issue for a long time. Are there any news?

Same problem. Popups are not working with WPML translations, because always only main language popup is shown instead of the translated one.

The task is still WIP (work in progress), that’s what I see in our internal bug tracker. Once the task is completed, we will update this thread.

Thanks for the patience,
M

1 Like

I’m facing the same issue with “WPML multi-currency” on popups.

I’ve created a paywall Popup, and the product price is not shown on multi-currency, only on the default currency. On the rest of the site, multi-currency prices are shown fine. The issue is on popups.

Same issue also happens on other ajax queries, like infinite scrolls on query loops.

UPDATE: WPML multi currency was giving some other Ajax issues, apart of popups. so uninstalled and tried “FOX - Currency Switcher” which works perfect on popups.

Hi guys,

We’ve fixed this issue in Bricks 1.11 BETA, now available as a manual download (Bricks – Account)

Please let us know if you are still experiencing issues.

You can see the full changelog here: Bricks 1.11 Changelog – Bricks

As with any beta release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.

Best regards,
Matej

1 Like

For me the problem persists, in my case I have the interaction inside the header template, both the condition and the interaction are faulty. I’m using version 1.11.
In the case of the condition for the post id of a specific page, when I enter the page in English it doesn’t work.
And in the case of the interaction, it’s a popup that doesn’t open either and the data-interactions shows the templateId of the native language and not the translated one.