• Resolved mottaghian

    (@mottaghian)


    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

    (@oscargare)

    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

    Thread Starter mottaghian

    (@mottaghian)

    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

    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

    (@oscargare)

    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

    (@mottaghian)

    Thank you for your reply.

    So if we use for this url (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.