Announcement

Collapse
No announcement yet.

Geolocation to serve up info

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Geolocation to serve up info

    I have a store owner that would like to be able to display a phone number based on the customer's location, it would only be 3 offerings, the US, Ireland, and the rest of the world. Is this doable?
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    I'd recommend doing this by way of adding Cloudflare in front of the site; preferably the $20/mo Pro plan given the huge list of other benefits, but the free plan should work too. Better than paying for a geolocation service. Then you can look at the CF-IPCountry header to determine if the country is US, IE or neither.

    https://support.cloudflare.com/hc/en...IP-Geolocation
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Originally posted by ILoveHostasaurus View Post
      I'd recommend doing this by way of adding Cloudflare in front of the site; preferably the $20/mo Pro plan given the huge list of other benefits, but the free plan should work too. Better than paying for a geolocation service. Then you can look at the CF-IPCountry header to determine if the country is US, IE or neither.

      https://support.cloudflare.com/hc/en...IP-Geolocation
      Interesting - the next step would be how to incorporate that information into a snippet that displays the correct phone number.
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


        #4
        You'd want to list out the variables via diagtool or similar to confirm the name, but that header value would show up as a s.HTTP_ variable that template code can look at, which you could then base conditions on.
        David Hubbard
        CIO
        Miva
        [email protected]
        http://www.miva.com

        Comment


          #5
          Cloudflare looks interesting. Could it also be used to blocking certain traffic?

          For example, could it be used to block traffic from Lancashire UK which, I believe, is a county/region, as opposed to a city? Or any other hotspot that is placing fraudulent orders?
          Guy Turck
          The Glass Baby Bottle - Toxin Free Essentials for Babies & Toddlers

          Comment


            #6
            They only get as specific as country. I checked and they group all of United Kingdom into one selection option, nothing more specific. At the country level though, you can do a transparent challenge in Javascript, where legit shoppers just see a browser challenge for a few seconds and can then continue to shop for 30 minutes by default. That stops most bots / automated scripts that perform fraudulent orders. You can increase the level to a captcha challenge if there's a country you don't care too much about but still want to have the option of possible site access.
            David Hubbard
            CIO
            Miva
            [email protected]
            http://www.miva.com

            Comment

            Working...
            X