Guest jfrymann Posted November 17, 2009 Share Posted November 17, 2009 Is it possible to set the popular products to display a custom selection of products? The end result I am hoping for is to have an option in the admin area to set a product as a 'special' to display in a side box. The popular products template is close but uses the popularity rating rather than a custom selection. If it is not possible to do this through the admin area I'd also be okay with doing small updates directly to the code. I'm pretty sure this is the statement in popular products that would have to be modified to cause it to select specific products, but I don't know how to change it. $db->select("SELECT I.name, I.productId , I.price,I.image, COUNT(I.productId) AS total FROM ".$glob['dbprefix']."CubeCart_order_inv AS O, ".$glob['dbprefix']."CubeCart_inventory AS I, ".$glob['dbprefix']."CubeCart_category AS C WHERE O.productId = I.productId AND C.cat_id = I.cat_id AND C.hide != '1' AND I.disabled != '1' AND I.cat_id > 0 GROUP BY I.name DESC ORDER BY total DESC", $config['noPopularBoxItems']); Any help would be greatly appreciated. Thanks! Quote Link to comment Share on other sites More sharing options...
goober999 Posted November 22, 2009 Share Posted November 22, 2009 Is it possible to set the popular products to display a custom selection of products? The end result I am hoping for is to have an option in the admin area to set a product as a 'special' to display in a side box. The popular products template is close but uses the popularity rating rather than a custom selection. If it is not possible to do this through the admin area I'd also be okay with doing small updates directly to the code. I'm pretty sure this is the statement in popular products that would have to be modified to cause it to select specific products, but I don't know how to change it. $db->select("SELECT I.name, I.productId , I.price,I.image, COUNT(I.productId) AS total FROM ".$glob['dbprefix']."CubeCart_order_inv AS O, ".$glob['dbprefix']."CubeCart_inventory AS I, ".$glob['dbprefix']."CubeCart_category AS C WHERE O.productId = I.productId AND C.cat_id = I.cat_id AND C.hide != '1' AND I.disabled != '1' AND I.cat_id > 0 GROUP BY I.name DESC ORDER BY total DESC", $config['noPopularBoxItems']); Any help would be greatly appreciated. Thanks! Hi, you would need to add a new column to the inventory table, something like "custom", or whatever name you like. then edit the admin product edit page to update that field when you save the product. Once that is done, change the SQL line above to this. Any help would be greatly appreciated. Thanks!$db->select("SELECT I.name, I.productId , I.price,I.image FROM ".$glob['dbprefix']."CubeCart_inventory AS I, ".$glob['dbprefix']."CubeCart_category AS C WHERE I.custom = '1' AND C.cat_id = I.cat_id AND C.hide != '1' AND I.disabled != '1' AND I.cat_id > 0; 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.