Can someone please help me with a mod I'm trying to put together regarding Product Clearance items.
I have created a category called "Clearance" and have added several clearance products to it. What I would like to do is display some of those products on the home page and show them in random order.
So this is what I need... I need the following code in my clearance.php file to query the database for all products in the "Clearance" category and select 5 of those products in random order (oh, and btw, I have already completed the clearance.tpl file so I don't need any help there... just the php).
Here is the code I need to modify in my clearance.php file:
Code:
<?
// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[categories] WHERE forsale='Y' AND avail>0 AND $sql_tbl[categories].productid=$sql_tbl[products].productid AND categoryid='264' ORDER BY RAND() LIMIT 5 ";
// give the product array to smarty to make it available sitewide.
$specials = func_query($query);
$smarty->assign("clearance",$clearance);
?>
If I can get this mod to work, I'll post all code and instructions here for everyone to see and use.