• Resolved davidospinacolombia

    (@davidospinacolombia)


    Hello there! Thanks for reading.

    I need help with the site https://www.whywait.com.co. It is a colombian online store, and it has a child theme, WPML, WooCommerce updated, Geolocation activated, no cache plugins at all, WooCommerce Price Based on Country (Basic) and 4 prize zones: Colombia, Europe, Latin América and Rest of the World, with prices and currencies set properly.

    But, for some reason, geolocation is not working! I already checked, double-checked and manually re-uploaded the MaxMind GeoIP database, and it’s detected properly (…/wp-content/uploads/GeoLite2-Country.mmdb), deleted the WooCommerce Price Based on Country (Basic) and re-installed it, deleted WooCommerce and re-installed it, rebuilt the prize zones (And the custom prices for each zone), used Geolocation with caching support and standard Geolocation, read another support topics here looking for answers and nothing seems to work at all!

    By the way, this is a fragment from the status log:

    ### Geolocation debug info ###

    HTTP_CF_IPCOUNTRY: ?
    GEOIP_COUNTRY_CODE: ?
    HTTP_X_COUNTRY_CODE: ?
    HTTP_X_REAL_IP: ?
    HTTP_X_FORWARDED_FOR: 192.185.189.170
    REMOTE_ADDR: 190.151.234.231
    Real external IP: 190.151.234.231

    Is this relevant? If it is, How can I fix my issue?

    Please, somebody, help me!!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter davidospinacolombia

    (@davidospinacolombia)

    The very nature of the problem, by the way, is that, regardless of the customer’s location, the site always believes that she/he is from USA! And so it shows the prices for the US zone.

    Please help me!!

    Plugin Author Oscar Gare

    (@oscargare)

    Thread Starter davidospinacolombia

    (@davidospinacolombia)

    Yes, man, absolutely correct!

    The problem was fixed with the adding of a line of code to wp_config.php, as you suggest in the other topic.

    I will put it here, in case someone has the same problem in the future:

    The WooCommerce geolocation function is always returning the United States as customer country because your server variable HTTP_X_FORWARDED_FOR does not contains the real user’s IP.

    HTTP_X_FORWARDED_FOR: 192.185.20.98
    REMOTE_ADDR: 183.82.16.81, This IP matchs with your real external IP (183.82.16.81)

    To solve it you have 3 options:
    + Contact your hosting support to solve the issue.
    + Add Cloudflare to your site. Cloudflare includes geolocation and it’s free.
    + Add the following code to your config.php before the text /* That’s all, stop editing! Happy blogging. */:

    $_SERVER['HTTP_X_FORWARDED_FOR'] = $_SERVER['REMOTE_ADDR'];

    I hope this helps you.

    Thank you so, so much!! It was a lot of help!!

    Hello

    I’d just seen your feed on this topic – I’ve been looking for a plugin that can help with the original question.

    I downloaded the plugin and got it set up except when I add in a zone it only lets me add the UK, I can’t add any other location. Ideally, I need EU zone and the rest of the world.

    Any help you could give would be great

    Plugin Author Oscar Gare

    (@oscargare)

    Hi @milliebu,
    the available countries for the pricing zones are the countries includes in the WooCommerce option “Selling location(s)” at WooCommerce > Settings > General.

    EEk sorry! I didnt realise!

    Thank you so much for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Geolocation not working, please help!’ is closed to new replies.