Jump to content
TDLWebs

Category Sort Asc by Default?

Recommended Posts

Hi,

I realise that categories can be dragged and dropped into order in the admin, but my client has literally hundreds (not an exaggeration) of sub-categories.

Is there a way of sorting product categories in alphabetical order by default? If I remember rightly, I installed a mod for version 3 but there doesn't seem to be anything available for V6.2.2

Thanks,

T

Share this post


Link to post
Share on other sites

I am reading what you want to do a couple of different ways: Permanently override the admin's arbitrary sort, or Affect a reset of the sort order to alphabetical, still allowing for an arbitrary sort.

If to list child categories alphabetically, permanently, then:

In the file catalogue.class.php, function getCategoryTree(), near line 756, find:

if (($categories = $GLOBALS['db']->select('CubeCart_category', array('cat_parent_id', 'cat_id', 'cat_name'), array('cat_parent_id' => $parent_id, 'status' => 1, 'hide' => 0), 'priority, cat_name ASC')) !== false) {

Change to:

if (($categories = $GLOBALS['db']->select('CubeCart_category', array('cat_parent_id', 'cat_id', 'cat_name'), array('cat_parent_id' => $parent_id, 'status' => 1, 'hide' => 0), 'cat_name ASC')) !== false) {

 

Share this post


Link to post
Share on other sites

Thanks for that @bsmither,

Yes, I am looking to override the arbitrary sort and list categories in alphabetical order permanently. 

So I have edited the file and cleared the cache but unfortunately it doesn't seem to be working, either in admin or on the front end.

Any idea why?

T

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×