I tried the code from the main installation to get random items but I am using the plugin. I found another topic about random products but it was it you specified a category. I would like to just randomly pull items from the database to the front page as featured items. How do I do this in the plugin?
Nothing changed when I edited the code. Is there another place to set featured items other than the main PT script?
Hi,
Could you email me your modified pto_featured.php and I'll check it out on my test server for you...
Cheers,
David.
--
PriceTapestry.com
Hi,
In the plugin, normal Featured Products are selected by this code at line 31 of pto_featured.php:
$sql = "SELECT * FROM `".$pto_config_databaseTablePrefix."featured` WHERE name NOT LIKE '%/%' ORDER BY sequence";
To convert to random featured products; REPLACE this line with:
$sql = "SELECT name,1 AS sequence FROM `".$pto_config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 3";
...simply change the value of LIMIT as required for more or fewer than 3 random products...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com