Latest Register Log In

+ Advanced Search

Distance Range Searches

Distance Range Searches
By
04/24/08 (Edited 10/31/17)

At Admin Panel -> Settings -> Switches, the "distance range search" switch enables searching by distance amongst listings that have an address. When enabled, search forms will have additional fields to ask the searcher how many files from a specified city they wish to see results for. In some themes/configurations the distance fields will only be in the advanced search form, in some they'll also be on the front page, and on some they'll be in the wrapper quick search as well... you can copy the template code for it from the advanced search page to elsewhere if desired.

When you activate the switch, you'll be presented with a screen on which you can load data for various countries. If you don't load anything here, all searching will be done with the geolocation database which you will have to install if you didn't do that during the original site installation setup. The geolocation database contains major world cities, so people will be able to search for distances from cities -- but it doesn't allow searching by postal code or small towns. By loading one of the separate country datasets you can get support for postal code searches and smaller towns.

Note: These postal code databases will take a lot of database space. Secondary note: The data available only covers a few countries. If you've located a database for your country which contains the latitude and longitude for every postal code, contact support to discuss integrating it.

As the searcher types in their city, the autocomplete guides them with suggestions to help them type it in the right format (as many cities or countries can be typed different ways).

If up want to let people search for all listings within a specified distance of a city, without a search term, all you need to do is remove the input name="search" field from the form. To finding all listings within a distance, without a search term, inside a particular category... just add
in category <input type="hidden" name="catidcondition" value="="><select name="catidsearch">{CATOPTIONS}</select>
to the form.




Description Searching for items within a distance of a city or a zip or postal code.
Rating
Views 735 views. Averaging 0 views per day.