Search field for "NEAR" is broken?

Home Forums Calendar Products Events Calendar PRO Search field for "NEAR" is broken?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #155458
    bsc2172
    Participant

    When I type in New Jersey in the “NEAR” field, no events for New Jersey show up. Same applies for other states. Am I missing something obvious? This is how our users will use the site. They want to find events in their own state. How is this possible?

    #155664
    Barry
    Member

    So it’s important to remember that you will have specified a search distance limit (in Events → Settings → General, or else it will be whatever the default value is – but let’s say 50 miles).

    If you search for a town like Ridgewood – and there is an event in that town – it is highly likely that if we use the very centre of Ridgewood as the datum we’ll get a result. When a much larger geographical entity is specified, though – such as a US state – that isn’t true. The centrepoint for a state may easily be in excess of 50 miles away from one or more towns and cities within that state.

    For that reason, it’s quite easy to pull some empty result sets in this sort of scenario.

    Does that make sense/at least clarify things?

    #156188
    bsc2172
    Participant

    So, in the location box, it only accepts zip codes?
    How do we change LOCATION to Enter Zipcode ?

    #158297
    Barry
    Member

    Well, it doesn’t only accept zip codes – it accepts all kinds of place names – but you could probably change the placeholder text to ‘Enter zipcode’ if you wished to effectively steer customers into just providing zips.

    add_filter( 'tribe-events-bar-filters', 'change_location_filter_placeholder', 20 );
    
    function change_location_filter_placeholder( $filters ) {
    	if ( ! isset( $filters['tribe-bar-geoloc'] ) ) return $filters;
    	$find = 'placeholder="Location"';
    	$replace = 'placeholder="Enter zipcode"';
    	$filters['tribe-bar-geoloc']['html'] = str_replace( $find, $replace, $filters['tribe-bar-geoloc']['html'] );
    	return $filters;
    }

    You could try adding some code like this to your theme’s functions.php file to achieve this.

    Does that help?

    #194180
    indrakubicek
    Participant

    Searching by location seems to mostly be broken/ not working for me, and it doesn’t seem to be related to the distance issue mentioned above because I’m searching for whole countries.

    If I search for Turkey it finds the events in Turkey. However, if I search for Spain, or France, or Mexico (where there are also events) it says no events found! (have try for yourself on http://omexchange.staging.wpengine.com/events/ )

    What is happening and how can I fix it?

    #701516
    Barry
    Member

    I’m sorry we missed your post, first of all, indrakubicek.

    Unfortunately a quirk of the forum meant we were only notified of follow-up replies if they were made by the original poster. Since quite a bit of time has passed I’ll close this thread, but if you do still need help with anything please don’t hesitate to create new threads as needed.

    Thanks again!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Search field for "NEAR" is broken?’ is closed to new replies.