This thread is resolved. Here is a description of the problem and solution.
Problem:
The client reported that the currency switcher was not being respected when using the 'cookie' storage strategy. Despite changing the currency on the EN site, it always reverted to 'GBP'. The client had already disabled server caching and set the 'default customer location' to 'No location by default'. The issue persisted even after applying a filter to use cookie storage.
Solution:
We advised the client to replicate the issue on a sandbox site and provided instructions for doing so. The client discovered that the problem was caused by adding the store strategy filter too late in the execution order, specifically during the 'init' action. The client resolved the issue by changing the action to 'plugins_loaded', which allowed the cookie value to be respected.
If you're experiencing a similar issue, we recommend you try changing the action hook to 'plugins_loaded' when adding your store strategy filter:
add_filter( 'wcml_user_store_strategy', function( $strategy, $key ) {<br /> return 'cookie';<br />}, 10, 2 );
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket with us.
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 2 replies, has 2 voices.
Last updated by 1 year, 1 month ago.
Assisted by: Osama Mersal.