Guest tuscanblue Posted December 2, 2005 Share Posted December 2, 2005 Is there a mod or a way to control the sort order of products on the product display. Your help is greatly appreciated. http://canetoadrecords.com/shop/index.php?...viewCat&catId=1 ie want to make the first cd no 5 and move 3 to 11. etc Quote Link to comment Share on other sites More sharing options...
Guest jbdancer Posted December 2, 2005 Share Posted December 2, 2005 http://webdesign.allgear.be/index.php?act=...rod&productId=3 Quote Link to comment Share on other sites More sharing options...
Guest tuscanblue Posted December 2, 2005 Share Posted December 2, 2005 Thankyou, thanks for the fast reply, and a free mod too, great, how do i get it after it goes to paypal at 0.00 Quote Link to comment Share on other sites More sharing options...
roban Posted December 2, 2005 Share Posted December 2, 2005 By default they are in alphabetical order. You can do it this way: You need to edit /includes/content/viewProd.inc.php On or around line 154, you'll find the following: ------------ CODE SAMPLE ---------- // build sql query for product options luuuuuurvely $query = "SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ". $glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `". $glob['dbprefix']."CubeCart_options_bot` INNER JOIN `". $glob['dbprefix']."CubeCart_options_mid` ON ". $glob['dbprefix']."CubeCart_options_mid.value_id = ". $glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `". $glob['dbprefix']."CubeCart_options_top` ON ". $glob['dbprefix']."CubeCart_options_bot.option_id = ". $glob['dbprefix']."CubeCart_options_top.option_id WHERE product =". $db->mySQLSafe($_GET['productId'])." ORDER BY option_name, value_name ASC"; ----------------------------------- (Note, In the file it is one long string but I made it multi-line to make it easier to read) At the end after the "ORDER BY", simply remove the ", value_name" (remove the comma with it). That will pull them in by the order in the database then. Go into your db and change the order to anything you like then upload the modified viewProd.inc.php. Quote Link to comment Share on other sites More sharing options...
Guest tuscanblue Posted December 2, 2005 Share Posted December 2, 2005 got it great, thankyou ill give that a try Quote Link to comment Share on other sites More sharing options...
Guest jbdancer Posted December 2, 2005 Share Posted December 2, 2005 Thankyou, thanks for the fast reply, and a free mod too, great, how do i get it after it goes to paypal at 0.00 download link has been send Quote Link to comment Share on other sites More sharing options...
Guest tuscanblue Posted December 2, 2005 Share Posted December 2, 2005 Thankyou for all your help guys, I really appreciate your efforts. Thankyou Greg Quote Link to comment Share on other sites More sharing options...
Guest LitBitas Posted August 31, 2007 Share Posted August 31, 2007 I know that here was lots of quoestions like mine, but now i cant find answer Half year ago i found in this forum how to change "ORDER BY" in viewCat.inc (i think) to sort products by item code - 6 digits in our shop (productCode i think) (020456 goes after 010678 etc) but after upgradeing to SEO it gone, and now i cant find right topics in this forum, all links are wrong and i cant make it again Maybe somebody can help pls. Cheers. Quote Link to comment Share on other sites More sharing options...
roban Posted August 31, 2007 Share Posted August 31, 2007 Open /includes/contents/viewCat.inc.php Find somewhere @ line 158 $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']); Replace it with $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 name ASC"; Quote Link to comment Share on other sites More sharing options...
Guest Posted September 16, 2007 Share Posted September 16, 2007 By default they are in alphabetical order. You can do it this way: You need to edit /includes/content/viewProd.inc.php On or around line 154, you'll find the following: ------------ CODE SAMPLE ---------- // build sql query for product options luuuuuurvely $query = "SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ". $glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `". $glob['dbprefix']."CubeCart_options_bot` INNER JOIN `". $glob['dbprefix']."CubeCart_options_mid` ON ". $glob['dbprefix']."CubeCart_options_mid.value_id = ". $glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `". $glob['dbprefix']."CubeCart_options_top` ON ". $glob['dbprefix']."CubeCart_options_bot.option_id = ". $glob['dbprefix']."CubeCart_options_top.option_id WHERE product =". $db->mySQLSafe($_GET['productId'])." ORDER BY option_name, value_name ASC"; ----------------------------------- (Note, In the file it is one long string but I made it multi-line to make it easier to read) At the end after the "ORDER BY", simply remove the ", value_name" (remove the comma with it). That will pull them in by the order in the database then. Go into your db and change the order to anything you like then upload the modified viewProd.inc.php. Where is the db located? Quote Link to comment Share on other sites More sharing options...
Guest SafariWoman Posted October 29, 2007 Share Posted October 29, 2007 Open /includes/contents/viewCat.inc.php Find somewhere @ line 158 $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']); Replace it with $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 name ASC"; Hello, If I add a field in my inventory data base titled -- order -- and give each product a numerical value in this field depending on what order I want an item to appear on the products list in the category page that has nothing to do with name, idcode, description etc.. would the last words on the replace it with instructions be "ORDER BY order ASC"; ??? Thanks for any help! I need to place things in an order that is up to my frequently changing needs. 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.