View Full Version : Sort by zip code distance?
November 13th, 2007, 09:03 PM
This is pretty necessary if you have zip codes integrated. You should be able to sort the ads by the ones closest to you like on AutoTrader and other classifieds sites. This has been brought up a few times before. I think it would help the script immensely.
January 25th, 2008, 12:12 PM
I'd like to second the request for this feature. Any site selling items that can't easily be shipped needs this. I get this question all the time on my sailing site.
January 25th, 2008, 01:11 PM
You would think that sites focused on cars, boats, motorcycles, and anything else that can't fit in a 10x7" box would really benefit from this feature. Most people like to deal with local transactions but if they can't sort by distance the zip code feature is useless to them.
But I've been asking for this feature for years now. I doubt it will happen at this point.
January 25th, 2008, 01:28 PM
The issue is that to sort by a field that is usually a field in a database you sort by and simply put this is not the case as this is something that is generated on the fly after a user enters a zipcode. We sort as close as we can and one could add a sort by zipcode but there is no telling if this is totally accurate. This has been discussed at length
January 30th, 2008, 05:17 PM
It seems like you already have most of the calculations to do this, just need to store the calculated distances in an array or temp table and sort on that.
Sorting the results of a distance search is basic expected result. See any "store locater" type script, the results wouldn't be near as good if they worked like Classifieds.
Here's an example, try the zip search for Radio Shack stores here.
If you decide it's too difficult to provide distance sort in the "sort by" drop down list, at least sort the results that come from advanced search in the "sort by distance" section, which finds the results within a selected distance, but ironically doesn't "sort by distance" at all.
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.