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

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