Skip to content Skip to sidebar

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

Problem:
The client was experiencing an issue where AJAX fragments in a mini-cart were returning in the wrong language when the page was cached. This problem persisted despite the 'Store a language cookie to support language filtering for AJAX' setting being enabled. The issue seemed related to the timing of the cookie change during page load, which was suspected to be too late, affecting AJAX actions.

Solution:
We recommended the client to deactivate all unrelated plugins and test with only WPML, LiteSpeed Cache, WPML String Translation, WooCommerce, BricksUltimate, and WPML Multilingual & Multicurrency for WooCommerce active. This setup did not reproduce the issue, suggesting an interaction between LiteSpeed and another plugin was causing the problem. We advised the client to identify the problematic plugin by reactivating them one by one and checking the mini-cart's behavior. Additionally, we provided a workaround involving a custom plugin designed to handle the specific caching and language switching scenario. The client was instructed to install and activate this plugin, then monitor the mini-cart's behavior.

If this solution does not resolve the 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 problems persist, please open a new support ticket at WPML support forum.

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 41 replies, has 0 voices.

Last updated by Carlos Rojas 1 week, 3 days ago.

Assisted by: Carlos Rojas.

Author Posts
December 19, 2025 at 10:51 am #17677377

denisW-4

Thanks Lucas. Do you have any update on this?

I checked the new staging website yesterday and it looks like no one has even logged in yet since my last update.

December 19, 2025 at 12:53 pm #17677928

Lucas Vidal de Andrade
WPML Supporter since 11/2023

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: Europe/Vienna (GMT+01:00)

Hi Denis,

Thanks for your patience.

After thorough testing, we’ve confirmed that the caching setup is now functioning correctly — the language cookie is being set as expected, and AJAX requests reflect the correct language.

However, we’re still seeing the issue where parts of the mini-cart display in the wrong language after switching. This doesn’t happen when using a default WooCommerce theme with the built-in mini-cart (with the workaround plugin active). That suggests the issue is specific to the Bricks Unlimited extension you’re using for the mini-cart.

I tested the Bricks builder itself with a basic mini-cart widget, on a fresh website, and it worked fine. So the problem appears to be tied specifically to the Bricks Unlimited mini-cart widget.

Would it be possible for you to switch to the native Bricks mini-cart widget instead? We expect that to work correctly with the current setup and workaround.

If switching isn’t an option and you prefer to continue using Bricks Unlimited, please note that resolving this may take more time than the many hours it already has, as it’s a niche, unsupported integration. It could involve contacting the plugin developers directly if deeper changes are needed.

Let me know how you’d like to proceed.

Best regards,
Lucas

December 22, 2025 at 8:38 am #17681471

denisW-4

Hi Lucas,

Unfortunately I use parts of the mini-cart system on other places on the website aswel, and Bricks does not have a 'native' mini-cart.

Switching in this case is not an option for me... I understand this may take more time then usual and contacting the plugin developer, that's OK for me.

I already contacted the plugin developer twice, but he ended up saying that 'he has no clue' and kind of left it there.

If the WPML support could help out with this I would be super grateful.

Thank you.

December 22, 2025 at 2:15 pm #17682445

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hello,
My name is Carlos, and I will continue working on this ticket because my colleague Lucas is on vacation

I have updated our 2nd-tier specialists with your latest message, and I will get back to you as soon as I get more information from them.

Best regards,
Carlos

December 23, 2025 at 10:42 am #17684278

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi,

Our 2nd-tier specialists ran the tests with the native Bricks mini cart -see attached image- and it worked correctly. They are trying to set up an example page. I will keep you updated.

Screenshot 2025-12-22 at 14.29.28.png
December 24, 2025 at 10:15 am #17686328

denisW-4

Hi Carlos, thank you for taking over from Lucas.

I am not 100% sure what you mean by "complete setting up the single product template with the BU mini-cart widget" as in my website the mini-cart is a single template, which is inside a header template.

But I've now added a mini-cart right into the single product template, so it's all in there. Is this what the 2nd-tier specialist had in mind?

I greatly appreciate the 2nd-tier team going this far to try and solve this issue, thank you again for that.

The upcoming few days I may reply a little later due to the holidays.

Kind Regards,
Denis

December 24, 2025 at 10:20 am #17686344

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi Denis,

What happens is that we don't have a way to register the BU plugin, so we need you to complete the setup and reproduce the issue so our 2nd tier can continue isolating the cause of the problem.

Please let me know if you registered BU and reproduced the issue in the sandbox site?

December 24, 2025 at 10:29 am #17686471

denisW-4

Hi Carlos, I understand.

I've registered the BU plugin and created the mini-cart inside a single product template.

As far as reproducing the issue; for that I would need to translate the page/template first and add caching. When trying to translate:

Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/sites/blue-drum/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php on line 154

And second thing is, in my case, I use LSCache plugin for caching. The issue is only on cached pages. I don't know if this issue will also occur if the page is cached by other plugins/ways... As this seems to be a Nginx server I cannot use LSCache caching here.

Kind Regards,
Denis

December 24, 2025 at 10:36 am #17686476

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi Denis,
Thank you very much for your message and for creating the template

I have updated our 2nd-tier specialists with your message, and I will get back to you as soon as I get more information.

January 5, 2026 at 12:46 pm #17703991

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi Denis,

Our 2nd-tier specialists took a deeper look at the issue, and they were able to successfully translate the minicart in the sandbox site. They left this message for you:

Now, it seems to me the options are:
- The client activates the option to clear the cart when switching languages (said setting exists to bypass esoteric problems like these), or
- The client updates the sandbox to more accurately reflect the mini-cart design on the staging server (translating the updated template as they go) to see if it is possible to isolate what exactly in the setup causes it to go wrong. If they can do that, we might be able to propose a solution or suggest a solution to the plugin authors if relevant.

January 7, 2026 at 10:03 am #17708865

denisW-4

Hi Carlos,

Best wishes for the new year. Thank you and the 2nd tier team for the message.

- The 'clear cart on language change option' does not solve the issue. After the page has been cached, switching the language, confirming that I do want to change the language and clear the cart: the cart is still there + in the wrong language.

- I have updated the sandbox, this is now basically (almost) the identical setup:
1. Added a new template 'Header' and added a cart opening button there which opens the new 'Mini cart' template.
2. Added a new template 'Mini cart' with the cart query loop.
3. I translated both of these new templates into Spanish.
4. But like I said earlier, this is a Nginx server - I cannot add LSCache caching here. Without caching we cannot reproduce the issue. So the 2nd tier team will need to add caching.

Kind Regards,
Denis

January 7, 2026 at 10:40 am #17709071

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi Denis,
Thank you very much for your message, and Happy New Year to you too 🙂

I have updated our 2nd-tier specialists with your latest message so they can continue investigating this issue.

January 27, 2026 at 9:25 am #17765972

denisW-4

Hello, any news on this?

January 27, 2026 at 9:40 am #17766058

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi,

I'm consulting our 2nd-tier specialists.

January 28, 2026 at 9:10 am #17769815

Carlos Rojas
WPML Supporter since 03/2017

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

Timezone: Europe/Madrid (GMT+01:00)

Hi there,

Our 2nd-tier specialists took another look at the configuration and spotted that the LS cache settings for Excludes did not include the WPML language cookie, and that is needed for this to work.

So they added it, and now it appears that the mini-cart works as intended, and the setting to clear the cart when changing language also works (if you wanted to use it).

Can you confirm that the issue was solved?

Screenshot 2026-01-27 at 15.15.47.png