Guest ebooks Posted September 17, 2005 Share Posted September 17, 2005 I am trying to force the CCv3 main page to display the categories alphabetically instead of by category id. It seems that the sub-categories and products already display this way. In my /includes/content/viewCat.inc.php file on line 52, there is this line: $query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY cat_name ASC"; This appears to already be sorting by category name. In the /includes/functions.inc.php file on line 74 and 75, there is this: // get category array for cat dir $query = "SELECT cat_id, cat_name, cat_father_id FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id DESC"; I tried changing it to // get category array for cat dir $query = "SELECT cat_name, cat_id, cat_father_id FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_name ASC"; but it does not help. Ideas? My store is at http://www.ebookshoppingcenter.com/CubeCart3/index.php Quote Link to comment Share on other sites More sharing options...
roban Posted September 17, 2005 Share Posted September 17, 2005 Have you tried cahnging cat_name to value_name? Hope this helps Quote Link to comment Share on other sites More sharing options...
Guest Posted September 17, 2005 Share Posted September 17, 2005 If you find that alphabetical isn't quite what you need, I have a mod available on my site which will let you reorder the categories and sub-categories in any way you choose. It will also let you order your products by name, price and productID either ASC or DESC. There are several people running it now and very happy with it. Quote Link to comment Share on other sites More sharing options...
Guest ebooks Posted September 17, 2005 Share Posted September 17, 2005 Have you tried cahnging cat_name to value_name? Hope this helps I just tried your suggestion and it did not work. Ideas? If you find that alphabetical isn't quite what you need, I have a mod available on my site which will let you reorder the categories and sub-categories in any way you choose. It will also let you order your products by name, price and productID either ASC or DESC. There are several people running it now and very happy with it. The problem is that I am trying to get this thing working and I am next to no money at all. Unless you would consider a trade, I have no way to pay you. Sorry. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 18, 2005 Share Posted September 18, 2005 Drop me an e-mail to bill AT swscripts DOT com and we'll talk. I may be interested depending on what you have to trade. Quote Link to comment Share on other sites More sharing options...
Guest ebooks Posted September 18, 2005 Share Posted September 18, 2005 I sent you an email. Quote Link to comment Share on other sites More sharing options...
Guest estelle Posted September 19, 2005 Share Posted September 19, 2005 ebooks, functions.inc.php isn't the right file. If you want to change the ordering of the top level categories, the file you want to look at is includes/boxes/categories.inc.php. Quote Link to comment Share on other sites More sharing options...
Guest ebooks Posted September 19, 2005 Share Posted September 19, 2005 ebooks, functions.inc.php isn't the right file. If you want to change the ordering of the top level categories, the file you want to look at is includes/boxes/categories.inc.php. Thank you. I had not looked at that file. There is a line that says: $results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0"); How do I change it to sort by cat_name? Quote Link to comment Share on other sites More sharing options...
Guest ebooks Posted September 19, 2005 Share Posted September 19, 2005 Nevermind, I just figured it out. I changed the line to say: $results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0"." ORDER BY cat_name ASC"); Quote Link to comment Share on other sites More sharing options...
Guest ianfitch Posted September 19, 2005 Share Posted September 19, 2005 $results = $db->select("SELECT cat_name, cat_id FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = 0 ORDER BY cat_name ASC"); Quote Link to comment Share on other sites More sharing options...
Guest ianfitch Posted September 19, 2005 Share Posted September 19, 2005 Ha! you beat me to it! Quote Link to comment Share on other sites More sharing options...
Guest estelle Posted September 19, 2005 Share Posted September 19, 2005 Well done dude Apologies to Sir William if i spoiled your deal. But its just a small change, and ebooks had almost figured it out anyway :innocent: Quote Link to comment Share on other sites More sharing options...
Guest ebooks Posted September 19, 2005 Share Posted September 19, 2005 Actually, having so little money, I have to choose my mods paid carefully. I am looking at having one written tho. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 19, 2005 Share Posted September 19, 2005 That's fine estelle, my mod does more than just choose alphabetical order. It lets a user custom specify the order of all their categories and sub-categories. It also lets you specify which order your products will be displayed within that category. And coming soon will be the ability to display a random order and to let users specify their preferred sort order. Quote Link to comment Share on other sites More sharing options...
Guest estelle Posted September 19, 2005 Share Posted September 19, 2005 my mod does more than just choose alphabetical order I know and there will definitely be some people who will want the different options. And coming soon will be the ability to display a random order and to let users specify their preferred sort order. Sounds cool . Allowing someone to specify the exact order of items is great! (I achieve a similar thing by choosing my category ID and product code depending on how i want them ordered, but its certainly not an ideal solution) Quote Link to comment Share on other sites More sharing options...
Guest dscmusic Posted September 20, 2005 Share Posted September 20, 2005 i am trying to get the sub categorys products in name order and i trying this and it didn't work any ideas? Quote Link to comment Share on other sites More sharing options...
Guest Posted September 20, 2005 Share Posted September 20, 2005 Well, in the spirit of a never sleeping programmer, I added more stuff last night. The Category Order Mod now sorts both Ascending and Descending on the following: Name Price ItemID Stock Level (qty on hand) Popularity and a new option which will randomize the order of displayed products for each user. It's setup so that they will get the same overall sort order which will span multiple pages of a multi page category. This keeps them from seeing the same product on multiple pages. And next time they come visit your shop, they'll get a new sort order. This update will be free to anybody who bought the previous version. I'll get the download package updated as soon as I can. Quote Link to comment Share on other sites More sharing options...
Guest estelle Posted September 20, 2005 Share Posted September 20, 2005 dscmusic - look in includes/content/viewCat.inc.php Quote Link to comment Share on other sites More sharing options...
Guest dscmusic Posted September 21, 2005 Share Posted September 21, 2005 ok thanks i have sorted it now :) 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.