Guest on_way_to_fame Posted August 26, 2006 Share Posted August 26, 2006 Hi, When I add new products to my shop, they are shown in the end, when someone views the products by category. Is there any way, I can show the latest products first and the older ones later, in the category view? Thanks Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted August 27, 2006 Share Posted August 27, 2006 Yes, Under includes/content/ you need to change the viewcat.inc.php and add an order by productid desc. :D Quote Link to comment Share on other sites More sharing options...
Guest airjer Posted August 27, 2006 Share Posted August 27, 2006 Can you point out the exact area to edit this? Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted August 28, 2006 Share Posted August 28, 2006 Ok here it goes Remember to always BACKUP Find and edit under includes/content/ the viewCat.inc.php Find around line 159 $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbpref .............. etc etc.........ending with ...........CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']); Then add this ." ORDER BY productid DESC" at the end of the above line before the last ; That should do the trick for you, i know it worked for me Let me know I think i will make it in to a mod and submit it to the .org forum if its not there allready Also added to the FAQ pinned post :( Quote Link to comment Share on other sites More sharing options...
Guest airjer Posted August 28, 2006 Share Posted August 28, 2006 Would work if I didn't have 1000+ products! Due to the 1 in the beginning they go to the end too :/... Got a fix for that?! Well.. I'm not even sure if that is the problem because it seems some categories are sorted ok and others are just completely off.... www.ajkickz.com Quote Link to comment Share on other sites More sharing options...
Guest on_way_to_fame Posted August 29, 2006 Share Posted August 29, 2006 Cheers Vrakas..doesnt seem to be working for me though..once again..i wanbt the latest products at the top..and the older products at the bottonm..heres what my edited piece of code looks like? $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE hidden!='yes' and ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId'])ORDER BY productid DESC ; Ash Quote Link to comment Share on other sites More sharing options...
Guest airjer Posted August 29, 2006 Share Posted August 29, 2006 Yea it works I put it in the wrong spot... your code should look like this $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix']."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM ".$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON ".$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE ".$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY productid DESC"; Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted August 30, 2006 Share Posted August 30, 2006 As i mentioned, it worked for me, so this means it has been tested @airjer Glad you got it working @on_way_to_fame ['catId'])ORDER BY productid DESC ; ['catId'])." ORDER BY productid DESC" ; Notice the diference? ;) Quote Link to comment Share on other sites More sharing options...
Guest airjer Posted August 30, 2006 Share Posted August 30, 2006 @airjer Glad you got it working Yea thanks! ;) Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted August 30, 2006 Share Posted August 30, 2006 Welcome ;) 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.