Jump to content

Sorting my CCv3Categories


Guest ebooks

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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");

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

my mod does more than just choose alphabetical order

I know :innocent: 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 B). 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)

Link to comment
Share on other sites

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.

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...