Guest Toby Wallis Posted October 30, 2006 Share Posted October 30, 2006 I want to show several randomly-selected items on my front page where currently it shows most recently added. The featured items is a single product in a box on the side. So when you view the front page instead of having (as I have set it up) six most recent products showing, I would like six random products which would change when the page is reloaded. Is this possible? Or maybe a Mod? Thanks ===Toby=== Quote Link to comment Share on other sites More sharing options...
Robsta Posted October 30, 2006 Share Posted October 30, 2006 In /includes/content/index.inc.php, look for: $latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY productId DESC LIMIT ".$config['noLatestProds']); Change to: $latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY RAND(".$seed.") LIMIT ".$config['noLatestProds']); I think that should do the trick. Quote Link to comment Share on other sites More sharing options...
Guest Toby Wallis Posted October 30, 2006 Share Posted October 30, 2006 In /includes/content/index.inc.php, look for: $latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY productId DESC LIMIT ".$config['noLatestProds']); Change to: $latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY RAND(".$seed.") LIMIT ".$config['noLatestProds']); I think that should do the trick. Thanks, Robsta - I'll give it a try in the morning (1/4 to 11 here in UK) Quote Link to comment Share on other sites More sharing options...
Robsta Posted October 30, 2006 Share Posted October 30, 2006 Thanks, Robsta - I'll give it a try in the morning (1/4 to 11 here in UK)Welcome. I am also in the UK :) Quote Link to comment Share on other sites More sharing options...
Guest Toby Wallis Posted October 30, 2006 Share Posted October 30, 2006 Works like a dream - and only 10 mins to mod! Thanks a bunch. ===Toby=== Quote Link to comment Share on other sites More sharing options...
Robsta Posted October 30, 2006 Share Posted October 30, 2006 Excellent :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.