Skip Navigation

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.

Our next available supporter will start replying to tickets in about 7.09 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by cookingwithdog 1 year, 8 months ago.

Assisted by: luo.

Author Posts
August 4, 2022 at 2:13 pm #11804607

cookingwithdog

It seems the previous support gave me an inaccurate answer. https://wpml.org/forums/topic/woocommerce-multilingual-with-multi-currency-and-wp-rocket-issue/ I contacted WP Rocket support but they say the following. > WPML is in charge of setting the cookies themselves, i.e., it is WPML which causes the cookies to be "added to every single post and page".

August 9, 2022 at 1:33 am #11827671

luo

Hello,

The problem is in WP Rocket plugin side, if you deactivate WP Rocket plugin, you won't see those cookies in normal page, in plugin file plugins\wp-rocket\inc\3rd-party\plugins\ecommerce\woocommerce-multilingual.php, line 26:
add_filter( 'wcml_user_store_strategy', 'rocket_wcml_use_cookie_storage', 10, 2 );
It triggers the issue, you can use custom codes to remove it, for example:
Edit your theme file functions.php, add below line:
remove_filter( 'wcml_user_store_strategy', 'rocket_wcml_use_cookie_storage', 10);

You can see the result in same demo site:
hidden link

Same login URL:
hidden link

August 10, 2022 at 4:19 am #11837339

cookingwithdog

I added the line to functions.php, and the currency cookies were removed.

remove_filter( 'wcml_user_store_strategy', 'rocket_wcml_use_cookie_storage', 10);

I sent your reply to WP Rocket support and I am waiting for their reply.

https://wpml.org/wcml-hook/wcml_user_store_strategy/
hidden link

I might create a new ticket if anything comes up again.

Thank you so much for your help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.