I have got it working but I am doing the random part in the SQL query. My random.php is now:
Code:
<?
// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid ORDER BY RAND() LIMIT 2 ";
// give the product array to smarty to make it available sitewide.
$randoms = func_query($query);
$smarty->assign("randoms",$randoms);
?>
This seems easy enough to me, are there any drawbacks to doing it this way?
I also added the original featured products back into the random.tpl so now I can specify one or two perminant featured products (with the X-cart module) and have two random ones.
Any other sugestions? This seems too easy compared to other solutions

.