Title: Wrong currency when cache enabled
Last modified: October 23, 2020

---

# Wrong currency when cache enabled

 *  Resolved [mottaghian](https://wordpress.org/support/users/mottaghian/)
 * (@mottaghian)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/wrong-currency-when-cache-enabled/)
 * Hi,
    When I enable our caching plugin (wp-rocket) the currency doesn’t change
   correctly.
 * If I enable “Geolocation (with caching support)” on woocommerce, everything works
   but as this option adds ?v=XXXx string, I don’t want to use it coz it affects
   our page speed and SEO.
 * The other option which is “load product prices in the background” doesn’t work.
   I tried to check the debug info and it’s as follow:
 * Default customer location: geolocation
    MaxMind GeoIP database: checked MaxMind
   license: checked MM_COUNTRY_CODE: x GEOIP_COUNTRY_CODE: x HTTP_CF_IPCOUNTRY: 
   US HTTP_X_COUNTRY_CODE: x HTTP_X_REAL_IP: 104.237.226.43
 * the HTTP_CF_IPCOUNTRY coming from cloudflare correctly but I’m not sure if GEOIP_COUNTRY_CODE
   should show the same value or not?
 * I have also added $_SERVER[‘GEOIP_COUNTRY_CODE’] = ”; to wp-config as you mentioned
   on another post, but still the same.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Oscar Gare](https://wordpress.org/support/users/oscargare/)
 * (@oscargare)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/wrong-currency-when-cache-enabled/#post-13572959)
 * It is not a Geolocation issue.
 * For the “load product price in the background” does not work, review:
    [https://wordpress.org/support/topic/different-variations-by-country-and-cache-issue/#post-13521884](https://wordpress.org/support/topic/different-variations-by-country-and-cache-issue/#post-13521884)
 *  Thread Starter [mottaghian](https://wordpress.org/support/users/mottaghian/)
 * (@mottaghian)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/wrong-currency-when-cache-enabled/#post-13702432)
 * Hi Oscar,
 * Thank you for your support. Can we solve this cache issue by forcing an automatic
   URL parameter to the URL?
    I understand that “?wcpbc-manual-country=XX” forces
   the currency to switch. Is there a way to define a few regions (corresponding
   to the currencies we serve) and add this parameter based on the browsers geolocation
   as an ultimate solution for geolocation with caching?
 * For example, I want a customer who visits from US see this link:
    [http://www.mysite.com/?wcpbc-manual-country=Us](http://www.mysite.com/?wcpbc-manual-country=Us)
 * If it had the parameter correctly it keeps it, and if it didn’t exist or it was
   wrong (based on the geolocation coming form Cloudflare), it adds the parameter
   to the URL.
 *  Plugin Author [Oscar Gare](https://wordpress.org/support/users/oscargare/)
 * (@oscargare)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/wrong-currency-when-cache-enabled/#post-13703675)
 * Hi,
    Setting the country using the wcpbc-manual-country parameter creates a WooCommerce
   session (to store the customer’s country), which invalidates the cache. So it
   is not a solution.
 * If the “Load product price in the background” does not work with your theme, 
   you can use the solution provide by WooCommerce, set the the option “Default 
   customer location” to “Geolocation (with caching support)”
 *  Thread Starter [mottaghian](https://wordpress.org/support/users/mottaghian/)
 * (@mottaghian)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/wrong-currency-when-cache-enabled/#post-13704120)
 * Thank you for your reply.
 * So if we use for this url ([http://www.mysite.com/?wcpbc-manual-country=DE](http://www.mysite.com/?wcpbc-manual-country=DE))
   for all of our advertisement campaigns that are are for Germany, it creates a
   unique session for every browser and invalidate the cache?
 * Yes, we are using the native Geolocation with caching support of woocommerce,
   but it is affecting our speed (do to redirect) and quality scores on Ads. I’m
   trying to find a solution to have a specific url for each regions (currently 
   only 4) to have their currency correct.
 * Thank you again for your support

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Wrong currency when cache enabled’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-product-price-based-on-countries/assets/icon-
   256x256.png?rev=1976858)
 * [Price Based on Country for WooCommerce](https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [mottaghian](https://wordpress.org/support/users/mottaghian/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/wrong-currency-when-cache-enabled/#post-13704120)
 * Status: resolved