Guest tomcat Posted August 9, 2006 Share Posted August 9, 2006 Hello all, I would be grateful is someone would be able to tell me how do I get the products to list alphabetically without having to purchase a mod? Many thanks in advance Pete :w00t: Quote Link to comment Share on other sites More sharing options...
roban Posted August 9, 2006 Share Posted August 9, 2006 This should do it: open includes/boxes/categories.inc.php Find at About line 35 // query database $results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0"); $resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."'"); REPLACE WITH // query database $results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0 order by cat_name"); $resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".$lang_folder."' order by cat_name"); Quote Link to comment Share on other sites More sharing options...
Guest tomcat Posted August 9, 2006 Share Posted August 9, 2006 Thanks for the quick reply Will give it a try straight away Sorry to be a pain but... Does this list the product listings alphabetically or does it do the category listings? Quote Link to comment Share on other sites More sharing options...
roban Posted August 9, 2006 Share Posted August 9, 2006 I think it'll do both but if that doesn't work try: Open /includes/contents/viewCat.inc.php Find somewhere @ line 158 QUOTE $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 QUOTE $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 tomcat Posted August 9, 2006 Share Posted August 9, 2006 Hi roban, Don think that it is doing the products alphabetically. It is just doing the categories. Any ideas on how to do the products at all? Many Thanks Pete Quote Link to comment Share on other sites More sharing options...
convict Posted August 9, 2006 Share Posted August 9, 2006 $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 ".$glob['dbprefix']."CubeCart_inventory.name ASC"; Quote Link to comment Share on other sites More sharing options...
Guest tomcat Posted August 9, 2006 Share Posted August 9, 2006 Hi again, Thanks for all this help from both of you. This doesn't seem to be listing the products alphabetically though Any last thoughts for a cure? Many Thanks Peter Quote Link to comment Share on other sites More sharing options...
roban Posted August 9, 2006 Share Posted August 9, 2006 Have you cleared your cache? Quote Link to comment Share on other sites More sharing options...
Guest tomcat Posted August 9, 2006 Share Posted August 9, 2006 Hi roban, Yeah... cleared my cache. One of the first things that I did This is one of the sections of the store that I am just setting up: http://www.mirrorcraft.co.uk/buy/index.php...Cat&catId=2 Just a thought.. Does it sort it just alphabetically or does it do it alphabetically/numerically? Quote Link to comment Share on other sites More sharing options...
Guest tomcat Posted August 10, 2006 Share Posted August 10, 2006 Any thoughts? ;) 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.