WooCommerce Multilingual and some themes and plugins need to run AJAX calls on the front-end based on language information. For this purpose, you may need to enable a language cookie that supports AJAX filtering.
To enable language information for the front-end AJAX calls, go to WPML → Languages and scroll down to the Language filtering for AJAX operations section. There, check the Store a language cookie to support language filtering for AJAX option.
Enabling the language cookie that supports AJAX filtering on the front-end
Now, WPML will set a cookie using JavaScript which allows it to return the correct content for AJAX operations.
This is how this works for visitors:
For users that are logged-in, nothing changes and this setting is not applied. Language cookie is saved normally using PHP.
For users that are not logged-in, WPML checks if this setting is turned on and if so, the language cookie is set using JavaScript. This allows WPML to set the language cookie even if the site is cached.
If you use WPML 4.5 or later, this setting is enabled by default. If you notice it interferes with your caching plugin, you can disable it by following the same steps as detailed above.
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.