This issue depends on the caching system itself, which prevents the Currency Switcher from performing the currency conversion. Caching systems, such as WordPress plugins or reverse proxies (Varnish, Squid, etc), work by saving static copies of pages, which are then served when a new request arrives, without loading the whole WordPress/WooCommerce framework. Such mechanism can work well for sites whose content changes rarely, but it's not suitable for highly dynamic sites, such as the ones powered by the Currency Switcher, because they will often serve stale pages, containing incorrect currencies, rather than the fresh, dynamically generated ones.
The following is the flow when a caching system is enabled:
- A new (not cached) page is requested. Let's suppose that the active currency is USD.
- The Currency Switcher processes the products before the page is rendered, using the active currency (USD).
- The caching system saves a static copy of the prepared page (in USD) and serves it.
- At every subsequent request of the same page, regardless of the selected currency, the caching system serves the static copy of the page, with prices in USD. The page rendering process, during which the conversion takes place, is skipped completely; the Currency Switcher is not even loaded. In such case, no detection or conversion can take place.
- The page is served in USD, regardless of the selected currency, until the caching system decides that it's too old. It will then discard it, causing a new page to be generated with the active currency (let's suppose EUR).
- The page will now always be served in EUR, with the Currency Switcher being ignored, until the cache expires. The cycle will repeat indefinitely.
How to add dynamic caching to your site
How does Currency Switcher geolocation detection mechanism work?
You can purchase the Currency Switcher from our online shop.