Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author royho

    (@royho)

    Please post images of your settings so I can better help you.

    Thread Starter zackdn

    (@zackdn)

    Ok, when I use these settings I see this (which is correct).

    But, when I use these settings (please notice the “Test” box that is checked) I see this (NOT correct).
    ->Btw, I’ve even tried turning off the “Test” checkbox and having someone in NC test this and they see the same thing.
    ->Also, removing the two bottom lines of this configuration does not change anything for me or the people in NC.

    Thread Starter zackdn

    (@zackdn)

    Update: I changed some of your code to output the city, state, and country at the top of the page. On my machine and on a coworker’s iphone it shows “*My City* (obscured for security), FL, US”. Perfect.

    My counterpart in North Carolina only shows “US” 🙁

    Thread Starter zackdn

    (@zackdn)

    Another update: The issue I found was that her IP was not in the GeoLite2 database. So that seems to be the issue with that.

    However, it doesn’t seem like the “Test” button is working for hiding/showing product categories (as outlined above).

    Can you think offhand of an easy, update-proof way of downloading a PAID database into WordPress in order to pull form that more comprehensive list instead of the GeoLite2 one?

    Plugin Author royho

    (@royho)

    WooCommerce itself also uses the same database. Unfortunately we are at the mercy of what GeoLite2 provides.

    As for the test not working, that is a bug. Just a simple typo in the code which I will release an update for ASAP.

    Plugin Author royho

    (@royho)

    Ok version 1.5.2 has just been released which should fix the test mode issue.

    Thread Starter zackdn

    (@zackdn)

    That worked – thanks!

    I pay for access to the GeoIP2 City database, so I’m wondering if I might be able to extend the WC_Geolocation class and change the lines below to reference my paid database location.

    /** URL to the geolocation database we're using */
    	const GEOLITE_DB      = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz';
    	const GEOLITE_IPV6_DB = 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz';

    But I see that you’ve created your own similar class WC_Geolocation_Based_Products_Geolocate. I’m assuming I would also need to change this? Specifically this line:

    const GEOLITE2_CITY_DB = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz';

    Lastly, why do you update the database weekly if WooCommerce already does that?

    Plugin Author royho

    (@royho)

    If I remember correctly WC core just gets the countries and for this plugin, it would not suffice. That is why it has its own db for that.

    Does paying for it include more IPs? Or does it just mean it is updated more frequently?

    I could certainly add filters so you can use your own db.

    Thread Starter zackdn

    (@zackdn)

    Gotcha. Paying for it includes a lot more IPs and guarantee a 99% accuracy rate, but it is still updated weekly.

    The filters would be awesome, thank you.

    As I understand it, the db is a single file downloaded to the “Uploads” directory, correct?

    There’s a way to automatically download the commercial db to my server via a program MaxMind provides (GeoIP Update), but my host provider doesn’t support it. I’m going to have to manually download the file or see if there’s some other program that I can use to automate logging in and downloading the file every week. I’m just trying to make sure I understand how your plugin works.

    Thanks for all of your help, btw. I’ve never seen such a clean support forum for a wp plugin! 🙂

    Plugin Author royho

    (@royho)

    Ok after reading some more on the paid version, a simple filter will not suffice because in order to update to the latest database, you need to the credentials ( account ) that has this purchase (subscription). I don’t have an account on MaxMind and therefore don’t know what the steps are needed to add this function in and automate it.

    So for now, a hacky/manual work around is for you to download directly from your account and save and name the file geoip_city.dat and put it in your sites upload folder ../wp-content/uploads

    I hope that helps.

    Thread Starter zackdn

    (@zackdn)

    Ok, I figured this all out now and have changed my files. I’ve added two pull requests to your GIT to help explain my workaround and how hooks could be introduced to allow me to do this in a update-proof way.

    If you need to see my files I need a secure way to show them to you. I’m not comfortable showing them here.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Regions not working’ is closed to new replies.