Forums / Customization from the Admin / Categories in Admin

Categories in Admin

Started by aperfecthost on 15 Oct 2012, 2:22 AM · Views: 674

Results 1 to 7 of 7
15 Oct 2012, 2:22 AM
#1
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Categories in Admin

I would like to change the sort order of the categories in the admin. Right now they show by "sort" order. I would like to have them show by the name of the category, not the sort order that will show on the website,

15 Oct 2012, 9:34 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Categories in Admin

If I understand the question, Admin - Configuration - Layout Settings - Categories/Products Display Sort Order

15 Oct 2012, 4:01 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Categories in Admin

That sets the front end sort order, not the admin page sort order.
You can set the current display order in Catalog > Categories/Products > Categories/Product Display Order:[]
This will not be permanent, though; you will need to reset it each time you log in.

17 Oct 2012, 7:56 AM
#4
aperfecthost avatar

aperfecthost

New Zenner

Join Date:
May 2005
Location:
Rockwood, Tennessee, United States
Posts:
97
Plugin Contributions:
0

Re: Categories in Admin

Thank you. Is there a way to hard code it so it's always set that way?

17 Oct 2012, 1:17 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Categories in Admin

I presume the default value is set in the database, so you would need to find and alter that. I wouldn't try it unless you are comfortable with databases, and then only after making a full backup.

It might be in the file that handles that page... couldn't hurt to look around.

17 Oct 2012, 1:42 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Categories in Admin

/your_admin/categories.php handles that page, and it has code that sees if there is a session setting for categories sort order, and if not, uses the default constant value, CATEGORIES_PRODUCTS_SORT_ORDER. There is no other file in the fileset that contains that exact string, so it must be set in the db.

You could probably alter the value the file uses. First you would have to find out exactly what the alternate value is, then replace the constant in this statement with that value: ```php
if (!isset($_SESSION['categories_products_sort_order'])) {
$_SESSION['categories_products_sort_order'] = CATEGORIES_PRODUCTS_SORT_ORDER;
}

17 Oct 2012, 1:54 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Categories in Admin

My reading of the file is that the default value is 0 and the "sort by categories name" value is 1. I can't take more time on it now to confirm this.