Tell us what you are trying to do?
I made a dealer locator that is populated with dealers all over the globe.
The search function doesn't seem to be returning results the way a user intends when searching by country. If I want to see results from within 100 miles of the United States, I should get results for all of the United States and parts of Mexico and Canada, but instead I get Results for Oklahoma. For most of US users this hasn't been an issue because, they put in their state. It's a different story in Europe where searching by Country is very common.
If I search United Kingdom on maps.google.com, I get the entire United Kingdom and that's how I expect my dealer locator to work. The Dealer Locator should show EVERYTHING within 100 Miles Of the entire United Kingdom rather than 100 miles surrounding an invisible point within the Kingdom. I don't know where this invisible point is for the UK, but I have to expand the search 300 miles just to get our locations in Cambridge and Peterborough when searching "United Kingdom". No user is going to bother with that. They will assume we don't have any dealers within the UK.
I do hope this is just an error in how I set it up, a misunderstanding of the search settings perhaps, but in any case I need this working properly.
Is there any documentation that you are following?
I followed all relevant documentation when setting it up.
Is there a similar example that we can see?
maps.google.com
What is the link to your site?
I'd like to share my links privately.
Hi Shawn,
Thank you for contacting us and I'd be happy to assist.
Your observation is correct and the way distance based search feature works in Toolset, it brings in the results which are within the set radius of a specified location.
And from a specified location, it refers to a set coordinates on a map and not an entire geographical region's boundary (i.e. a country, province/state, or city, etc). Those coordinates can be a visitor's location through the "use my location" button or any address that he/she enters in the "enter a location" field.
For example, if someone will select "United States", it will use the geographical center coordinates of the country and then use it for the radius search's reference point.
Based on this the "/find-a-dealer/" page on your website is working as expected too. To make it easier for your visitors to understand how this search works, you can include a message that encourages them to enter a location near them, rather than selecting an entire area/region.
( on my many websites you'll see a "Find a dealer near me" page instead of "Find a dealer" page )
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
I think I understand, but perhaps there is another solution we can work with...
I'm attaching a screenshot to show how Cardinal Locator handled this, which would be acceptable for us. Even though the location "United Kingdom" is outside of their 150 mile radius, the side panel would show results in order of distance from the coordinates without the distance limit.
I'd like to replicate this on the current map view and make our view show all results in order of distance from query location when there are no results within the query location.
I'm also attaching screenshots of my view settings.
Just replying again to make sure you understood what I'm asking for help on...
In the attached screenshot you can see how Cardinal Locator handles the same issue that I've run into with my view. On Cardinal Locator, even though the queried location "United Kingdom" produces an alert to say results are outside of their 150 mile radius, the side panel on the left shows all results in order of distance from the coordinates without the distance limit. This is perfectly acceptable solution.
I need the list on the left in my view to always show results in order of distance regardless of the distance limit entered in the search. How do we accomplish this? I'm willing to start from scratch with a new view (or multiple views, if it's an issue of dependence). If you need to see our old Cardinal Locator system, I will need an IP address to whitelist your access to the link.
Hi Shawn,
Thanks for writing back.
I've reviewed the new requirements that you've shared and there is a workaround that you can try.
In your view's "Loop Editor" section, you'll see that the "No items found" message is shown when no results are returned.
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
You can remove that content from inside those [wpv-no-items-found] ... [/wpv-no-items-found] tags and instead, add a shortcode for a post view which will be a duplicate of your current view.
The only difference would be that for this new duplicated view, you'll remove all the extra HTML from the "Output Editor" and "Search and Pagination" section, including the map's shortcode.
And you'll also remove the distance "Query Filter" and instead only set order to show results based on the distance with respect to location passed through the URL parameter, set by the main/original view.
Example screenshot: hidden link
As a result, when there will be no dealer locations returned based on the main view's search, all of them will be shown from the second view, ordered by distance from the selected location.
regards,
Waqar
Brilliant Solution! Thank you for hearing us out and providing a solution. My issue is fixed.