Skip Navigation

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

Problem:
If you're experiencing an issue where your shopping cart displays items in the wrong language when adding products from an archive page, but it works correctly when adding from the product page or clicking the cart icon, we have a solution for you.
Solution:
We recommend enabling the WPML Ajax cookie. Here's how you can do it:
1. Go to WPML → Languages.
2. Scroll down to the 'Language filtering for AJAX operations' section.
3. Check the 'Store a language cookie to support language filtering for the AJAX' option.
You can find more information in our documentation here: Enabling language cookie to support AJAX filtering.
After making this change, please clear your cache to ensure that the new settings take effect.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at WPML known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, don't hesitate to open a new support ticket with us. You can do so here: 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.

This topic contains 7 replies, has 2 voices.

Last updated by Dražen 11 months, 2 weeks ago.

Assisted by: Dražen.

Author Posts
February 22, 2024 at 10:35 am #15332656

petrP-7

Good afternoon, I have a problem with my shopping cart. The site has 2 languages. If you view the site in Lithuanian and add an item to your cart, the mini cart opens a tab with added items in English. If press the button "View cart" it switches to English. How I could resolve this problem?

Untitled-1.jpg
February 22, 2024 at 11:01 am #15332974

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for contacting us.

This text is probably coming from your theme files and you would need to translate them.

-Go to WPML → Theme and plugins localization and select the theme and theme plugins, if there are some.
- Click to scan it.
- You should now be able to find the strings on the WPML > String Translation page.

- https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#strings-arent-selected-for-translation

Let me know how it goes.

Regards,
Drazen

February 22, 2024 at 11:09 am #15333016

petrP-7

All lines have been translated. If you go to the basket directly, everything is fine. The problem appears precisely after adding to cart in the tab of the cart pop-up window.

February 22, 2024 at 1:09 pm #15333694

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks, let me have a look.

Please share admin access and FTP if possible, I have enabled private boxes for your next reply.

Please make a backup before proceeding.

Regards,
Drazen

February 22, 2024 at 3:32 pm #15334445

Dražen
Supporter

Languages: English (English )

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

Hello,

I checked and I have enabled WPML Ajax cookies.

Went to WPML → Languages and scrolled down to the Language filtering for AJAX operations section. There, checked the Store a language cookie to support language filtering for the AJAX option.

- https://wpml.org/documentation/getting-started-guide/language-setup/enabling-language-cookie-to-support-ajax-filtering/

It works just fine now, image attached.

Make sure to clear the cache before checking as you might see the same result from before that is cached.

Regards,
Drazen

Screenshot_2.jpg
February 23, 2024 at 7:02 am #15336135

petrP-7

Hello,

I just tried to add to cart from the archive page and a tab appeared with untranslated items. Same bug. I've already cleared the cache twice. Could you check again?

February 23, 2024 at 8:08 am #15336290

Dražen
Supporter

Languages: English (English )

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

Hello,

please try now again I have completely disabled the cache plugin for you, as it seems you are seeing cached strings.

Can you please check if it works like this for you?

Regards,
Drazen

February 23, 2024 at 8:09 am #15336291

Dražen
Supporter

Languages: English (English )

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

Hello,

please try now again I have completely disabled the cache plugin for you, as it seems you are seeing cached strings.

Can you please check if it works like this for you?

Regards,
Drazen

February 23, 2024 at 10:30 am #15337030

petrP-7

Thanks, everything is working fine 🙂