Background of the issue:
I am trying to maintain the selected language when adding products to the shopping cart on my site hidden link. I have been following documentation from WPML to resolve this issue.
Symptoms:
When I add a product to the shopping cart in French or German, the language changes back to the main language, Dutch. However, when I add a product in English, the language remains English.
Questions:
Why does the language change to Dutch when adding products in French or German?
How can I ensure the selected language remains consistent in the shopping cart?
Welcome to WPML support. I will try to answer the question before the ticket is assigned to one of my colleagues.
The issue might be a conflict with a third-party plug-in that causes the language to change because in a normal way, whatever language that you are in should remain. To test that please do as follows:
- IMPORTANT STEP! Create a backup of your website. Or better approach will be to test this on a copy/staging version of the website to avoid any disruption of a live website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Woocommerce, WPML and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.
As a temporary test, you also can enable the option below and see if it prevents the language change: