• Hello,

    I’m using the WP Store Locator with the WP Store Locator Search Widget.

    I have stores in Germany and Austria. Is it possible to detect where the user comes from and then restrict the search results for the users country?
    As an extra I would like to have a dropdownfield where you can select your country and then the search results get restricted for it, if the user doesn’t want his location to be detected.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    It is possible to detect where the user comes from by enable the “Attempt to auto-locate the user” option on the settings page, but not to automatically restrict the search results to the users location.

    It’s likely you could restrict the map to the users country based on the used IP, but you will have to be comfortable with code to make this work.

    The country dropdown is possible, but also require you to be comfortable with code.

    So let me know if you’re comfortable with code, and I can point you in the right direction.

    Thread Starter phillip415

    (@phillip415)

    Yup, I’m comfortable with code. So could you tell me where to start to get this working? ??

    Thread Starter phillip415

    (@phillip415)

    I have stores in Germany and Austria. Is it possible to detect where the user comes from and then restrict the search results for the users country?
    As an extra I would like to have a dropdownfield where you can select your country and then the search results get restricted for it

    I now only need a selectfield where I can select a country and filter the results for it.
    I thought I could somehow do that with “Map region” + “Restrict the geocoding results to the selected map region” and then dynamically change a parameter in the google map url with javascript – but this didn’t seem to work. I have a shop in Germany and one in Austria for example, if I restrict the area for Germany, it still shows me the shop in Austria. Did I miss something?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Find out where the user comes from and then restrict the search results?’ is closed to new replies.