Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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 11.32 hours from now. Thank you for your understanding.

This topic contains 3 replies, has 2 voices.

Last updated by Carlos Rojas 1 month, 2 weeks ago.

Assigned support staff: Carlos Rojas.

Author Posts
December 2, 2019 at 9:48 pm #5057065

thibaultG

Hi,

Where can I read more informations about this new feature in WCML 4.7.5?

"Skip Currency Switcher caching for NginxCache"

Is there any detailed informations somewhere from the devs. on how it has been implemented in the code exactly?

Thank you, Thibault

December 4, 2019 at 5:23 pm #5071121

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

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

Hello Thibault,
Thank you for contacting WPML support.

I'm consulting our specialists about your question. So far I just know that the hook "wcml_is_cache_enabled_for_switching_currency" is related to this.

I will get back to you as soon as I get more information from our developers.
Kind regards,
Carlos

December 4, 2019 at 5:24 pm #5071171

thibaultG

Alrighty thank you

December 5, 2019 at 3:13 pm #5077783

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

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

Hi Thibault,

There is not official documentation about this functionality.

I got this explanation from one of our specialists:
"The current currency is kept in the woocommerce session data, so any page-caching we do will confuse a page in one currency with a page in another currency (they have the same URL).

To avoid this, WCML tries to detect if there is caching plugin enabled and when there is it adds an URL parameter to indicate to the caching system that the page contents are indeed different.

The point is, we only detect w3-total-cache, siteground cache and nginx cache:
https://plugins.trac.wordpress.org/browser/woocommerce-multilingual/trunk/inc/currencies/class-wcml-multi-currency-resources.php#L45

For other caching plugins we expose that filter ...
For example, litespeed cache uses it
add_filter( 'wcml_is_cache_enabled_for_switching_currency', '__return_true' );

It's a filter that is meant to be used by plugin authors specifically."

Regards,
Carlso