Hi David
I'd like to display my price comp table in reverse, ie the highest price first. Presumably I need to change an ASC into a DESC somewhere, but for the life of me I can't see where!
Please can you let me know which file I need to modify.
Thanks
Simon
Hi Simon,
It was indeed simply in the SQL until the latest distribution, but since voucher codes may now be considered on the product page sorting is done within the PHP code using usort() and the cmp() function beginning at line 49 of products.php
function cmp($a, $b)
{
if ($a["price"] == $b["price"])
{
return 0;
}
return ($a["price"] < $b["price"]) ? -1 : 1;
}
To reverse the sort order, REPLACE the above code with:
function cmp($a, $b)
{
if ($a["price"] == $b["price"])
{
return 0;
}
return ($a["price"] > $b["price"]) ? -1 : 1;
}
Cheers,
David.
--
PriceTapestry.com