You may wish to sort search results using multiple fields. Open-Realty┬«  supports sorting using up to 2 fields, separated by a comma (see examples below).


For example you may want to have your search results sorted by City so all listings are grouped by their city and then sorted by price within those groups. Placing the city as the first sortby and the price as the second sortby will accomplish this. You will need to add a hidden field to your search form to add the additional sortby values to pass it to the search results URL string unless you are hard coding links to specific search results.


This example will sort results by Featured Listings first and then by price. All of your listings that are set to be featured will appear first and then the rest of the listings will appear. They will all be sorted by price as well.


$_GET URL example:

&sortby=listingsdb_featured,price&sorttype=DESC,ASC


Form element example:

<input type="hidden" name="sortby" value="listingsdb_featured,price"/>

<input type="hidden" name="sorttype" value="DESC,ASC"/>



This example will sort results by City first and then price. All of your listings will be grouped by city and then sorted by price within those groupings.


$_GET URL example:

&sortby=city,price&sorttype=DESC,ASC


Form element example:

<input type="hidden" name="sortby" value="city,price"/>

<input type="hidden" name="sorttype" value="DESC,ASC"/>


Related Topics:
Listings Notification
Editing Listings
Search Page Options
Search Result Options
Search Page Order Tab
Search Results Order Tab
Main Template Tags
FEATURED/RANDOM LISTINGS TEMPLATES
Featured/Random Template Tags
SEARCH PAGE TEMPLATES
Custom Search Pages
Date and Time related searches
Additional Search String Variables
Search Page Template Tags
Search Results Template Tags
Search Results
FREQUENTLY ASKED QUESTIONS (FAQs)
TROUBLESHOOTING