This is straight forward, but care would need to be taken on a very large dataset. Look in search.php for the following line:
$sql .= " ORDER BY search_name";
To sort product search results by price ascending, change this to:
$sql .= " ORDER BY price ASC";
.. or by descending price:
$sql .= " ORDER BY price DESC";
If you could let me know if this looks OK (I just tried it on WebPriceCheck.co.uk) i'll build this into the search script so that a user can choose the sort field (i.e. a link along the top to switch to sort by price ascending or descending). There are some "search engine friendliness" considerations alongside this sort of feature; so i'll have a sleep on that...!
Hi,
This is straight forward, but care would need to be taken on a very large dataset. Look in search.php for the following line:
$sql .= " ORDER BY search_name";
To sort product search results by price ascending, change this to:
$sql .= " ORDER BY price ASC";
.. or by descending price:
$sql .= " ORDER BY price DESC";
If you could let me know if this looks OK (I just tried it on WebPriceCheck.co.uk) i'll build this into the search script so that a user can choose the sort field (i.e. a link along the top to switch to sort by price ascending or descending). There are some "search engine friendliness" considerations alongside this sort of feature; so i'll have a sleep on that...!
Cheers,
David.