Disable Country Field

PhilPhil Member
in Help edited July 2008
Hiya,

Sorry to dredge this one up again as I know this question has been asked a few times but as I couldn't find a decent answer, here goes:

I've got a client who has roughly 80-90% of store purchases with a geoip lookup of "United States". Problem is the client is based in Australia and the overwhelming majority of purchasers are in Australia as well.

They're quite happy to do away with the country field altogether as their customers are starting to get the shits; so, how do I completely disable it - from checkout to receipt and the email?

Thanks guys!
Comments
  • brettbrett FoxyCart Team
    Hmmm... so it's misidentifying Australian IPs as US? We've had reports of this before.

    As far as forcing Australia, that's probably a really good question. Give us a few to think about it. You should be able to set the country with javascript, but we haven't tested.
  • PhilPhil Member
    Yeah it's annoying.

    "You should be able to set the country with javascript" - I've read a couple of posts about using JS, but there were never any specifics mentioned, just theoretical musings. If you do come up with a solution I'd be all ears. I'm starting to cop an ear-bashing from them, so if there is anything else I can do in the meantime please let me know.
  • brettbrett FoxyCart Team
    Yeah, we don't want you to get abused by your clients because our GeoIP db is out of whack. Odd and annoying though, as it should (supposedly) be 99% accurate, but that's clearly not the case for you.

    I'll see if I can do some testing and do the javascript for you. Perhaps a better solution would be a store setting that'd allow you to bypass the geo IP lookup and just use the store country by default? Would that make sense for you?
  • brettbrett FoxyCart Team
    We're working on this, and have it half-way there. We'll update when it's 100%.
  • brettbrett FoxyCart Team
    Try this:
    $j("#customer_country").val("AU");
    $j("#shipping_country").val("AU");
    $j("#customer_country_name").val("Australia");
    $j("#shipping_country_name").val("Australia");
    fc_ValidateLocationName("customer_country");
    fc_ValidateLocationName("shipping_country");
    fc_ValidateLocationName("customer_state");
    fc_ValidateLocationName("shipping_state");
    

    Stick that in a script tag somewhere beneath your ^^checkout^^. It seems to work in some cursory testing but give it some testing and let us know if it works for you.
  • PhilPhil Member
    Thanks Brett.

    For some reason I didn't get an email from the Forum notifying me of your post, so I only just put this in place today. I'll let you know if it works out.

    Did some testing here with IP's that showed up as "United States" and funnily enough the system tagged them as Australian. Any reason why it works on the MaxMind website but not with FoxyCart?
  • lukeluke FoxyCart Team
    We just upgraded to the latest database from MaxMind so there should be no reason for that. Can you please let us know what those ips are? We definitely want to follow up with MaxMind directly about this problem.
  • PhilPhil Member
    Hey Luke,

    What date exactly did you upgrade the DB?

    I've got a purchase from 203.4.236.150 on 21/07/2008 which MaxMind's demo shows as Australian but is tagged as United States by FoxyCart.

    Had another purchase yesterday which went through as Australian, but nothing today (as yet).
  • PhilPhil Member
    Hey Guys,

    Just following up - the last four purchases that have gone through are all saying the IP is from the United States. As was the case before, when I tested the IP's at MaxMind's demo locator it came up with Australia.

    I've put Brett's code in the head of the checkout page but it doesn't seem to have an effect.

    Any ideas? I'm really starting to cop it in the neck and most of the journalists are getting a bit narky about it.
  • lukeluke FoxyCart Team
    So sorry about this. I know it's a make or break thing for you and we definitely need to get it fixed. We're looking into some stuff right now and the test ip you gave us has helped us narrow it down to a database problem on our end. We should have a solution shortly.
  • lukeluke FoxyCart Team
    Ok, we can now officially say, it is working.

    Thank you, uniqueIntention. Without your help, this would have been a very difficult bug to find. It turns out, our database table was using signed integers instead of unsigned integers. A good portion of our geoip addresses were being represented as negative long numbers which would fail the geoip lookup every time.

    Thank you so much for your help. You've helped us improve our system for all of our international customers.
  • PhilPhil Member
    Top stuff mate - happy to see you've got it sorted out.

    I'm just glad to get the Press Club off my back about this! haha

    Cheers!
  • lukeluke FoxyCart Team
    Seriously, thank you so much for your help on this. That was a strange problem that we probably wouldn't have found for some time without international support.

    We're one step closer to e-commerce world domination...

    (did I just type that out loud?)
  • PhilPhil Member
    Hi guys - just for some final closure on this one, every transaction that's been processed has all come through tagged correctly as Australian.

    Thanks a bundle!

    Haha world domination indeed. You guys should start looking at white-labelling ala MailBuild/Campaign Monitor style - that would just about ensure complete domination.
Sign In or Register to comment.