Home › Forums › Calendar Products › Events Calendar PRO › Search field for "NEAR" is broken?
- This topic has 5 replies, 3 voices, and was last updated 9 years, 8 months ago by Barry.
-
AuthorPosts
-
May 9, 2014 at 1:48 pm #155458bsc2172Participant
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?
May 9, 2014 at 4:17 pm #155664BarryMemberSo 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?
May 10, 2014 at 5:38 am #156188bsc2172ParticipantSo, in the location box, it only accepts zip codes?
How do we change LOCATION to Enter Zipcode ?May 12, 2014 at 12:16 pm #158297BarryMemberWell, 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?
May 31, 2014 at 7:02 am #194180indrakubicekParticipantSearching 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?
August 26, 2014 at 8:26 am #701516BarryMemberI’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!
-
AuthorPosts
- The topic ‘Search field for "NEAR" is broken?’ is closed to new replies.