Geolocation search – Resrict by country

Home Forums Calendar Products Events Calendar PRO Geolocation search – Resrict by country

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #951749
    Catherine Grant
    Participant

    Hi,

    I understand it’s not possible to restrict the location search to only one country?

    Could you please point me in the right direction of where to modify the code? I can’t seem to work it out.

    Cheers.

    #951767
    George
    Participant

    Hey Catherine,

    Thank you for reaching out! I’m curious about exactly what you’re looking to do – can you clarify what location search you mean?

    For example, do you mean the distance parameters in the Filterbar add-on? Or do you mean the “Near:” search area in the default search bar, which holds the location “Chicago” in this screenshot for example → https://cloudup.com/cUCfRkfEwVu

    Just want to make sure I understand your goals clearly here, thanks Catherine!

    — George

    #951769
    Catherine Grant
    Participant

    Sorry, I mean the “Near:” search area in the screeenshot you provided.

    Thanks.

    #951840
    George
    Participant

    Thanks for clarifying that Catherine – this is unfortunately quite a complicated change to make, as far as I can tell, so while we cannot offer specific code examples here, there are a few ideas that come to mind:

    First would be to simply leave the default functionality in place, and hope that users only search for events on your site where they’re reasonably expected to be. So if all your events are in the US, for example, then hopefully users will mostly just search for cities within the US and not, say, Finland.

    Another option would be to use some custom JavaScript to watch for the latitude and longitude value populations for the .tribe-bar-geoloc-lat and .tribe-bar-geoloc-lng elements on the page, and if those values fall outside of the United States, then you could stop the suggested locations dropbox from even opening – or set CSS for the element just in this case that would make it invisible to the user, maybe even adding an alert style to the field element so that people know that they can’t use what they first typed.

    I’m sorry about how vague this advice may be – it’s not a simple thing to modify within our default JavaScript.

    Let us know if this advice helps at all, or if you have any other questions or concerns!

    Thanks,
    George

    #983944
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Geolocation search – Resrict by country’ is closed to new replies.