Hi David
Instead of featuring prices I want to have marks out of 10. So in the feed I will have a 'score' column instead of the price. But I still want to have the best one featured at the top. Seeing as the best one will be the higher number can I reverse it so that the highest "price" is featured at the top.
I hope that makes sense!
Thanks
Oliver
Hi Oliver,
Assuming that you are using the existing price column to hold your score value (no reason why that wouldn't work) then for the products page, simply look for the following code in products.php (line 12 in the distribution):
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."' ORDER BY price LIMIT ".$config_resultsPerPage;
...and change this to
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."' ORDER BY price DESC LIMIT ".$config_resultsPerPage;
(adding DESC to the SQL means "descending")
If your scores are integer values (1,2,4 etc.) then you can easily change the way the price is displayed. Wherever you come across:
$product["price"]
(or in some cases $mainProduct["price"] or $priceProduct["price"])
...you can use intval() to display it as a whole number:
intval($product["price"])
Hope this helps!
Cheers,
David.