Jump to content

Set Items in Side Box (Popular Products)


Guest jfrymann

Recommended Posts

Guest jfrymann

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!

Link to comment
Share on other sites

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;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...