Forums / Basic Configuration / Sort admin configuration menu

Sort admin configuration menu

Views: 1,217

Results 1 to 7 of 7
3 Dec 2024, 8:42 PM
#1
cath avatar

cath

New Zenner

Join Date:
Jun 2006
Posts:
21
Plugin Contributions:
0

Sort admin configuration menu

I'm using ZC 2.01 with the Fluorspar template, and no other plugins.

I'd like to change the sort order of the configuration menu in admin.

I followed these instructions: https://docs.zen-cart.com/dev/code/sorting_menu/

In the instructions, they mention admin/includes/languages/english.php - mine is called admin/includes/languages/lang.english.php - I'm assuming they're the same thing as I can't find anything else that's similar.

I changed this:

'CONFIGURATION_MENU_ENTRIES_TO_SORT_BY_NAME' => '4,2,3,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,30,31,32',

and it's made no difference. I tried logging out, deleting cookies, and clearing the cache.

Has anyone done this successfully?

Thanks!

3 Dec 2024, 9:36 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Sort admin configuration menu

This documentation needs to be updated - thanks for reporting this.

The constant CONFIGURATION_MENU_ENTRIES_TO_SORT_BY_NAME indicates which submenus under configuration should be alpha sorted.
The value of this constant in 2.1.0 is '1', which means only submenu 1 (Configuration > My Store) should be alpha sorted. Other menu entries under configuration are sorted using the sort order from the configuration table.

Does that make sense? If not, please tell me what you're trying to do and I'll help you get there.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

3 Dec 2024, 10:08 PM
#3
cath avatar

cath

New Zenner

Join Date:
Jun 2006
Posts:
21
Plugin Contributions:
0

Re: Sort admin configuration menu

Thanks so much for your time.

At the moment, this is the configuration menu order:

My Store
Minimum Values
Maximum Values
Images
Customer Details
Shipping/Packaging
Product Listing
Stock
Logging
Email
Attribute Settings
GZip Compression
Sessions
Regulations
GV Coupons
Credit Cards
Product Info
Layout Settings
Website Maintenance
Index Listing
Define Page Status
EZ-Pages Settings

but I'd like it in this order:

Attribute Settings
Credit Cards
Customer Details
Define Page Status
Email
EZ-Pages Settings
GV Coupons
GZip Compression
Images
Index Listing
Layout Settings
Logging
Maximum Values
Minimum Values
My Store
Product Info
Product Listing
Regulations
Sessions
Shipping/Packaging
Stock
Website Maintenance

I tried changing the sort order in the configuration_group table, but it had no effect.

4 Dec 2024, 12:40 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Sort admin configuration menu

OK. Edit admin/includes/languages/lang.english.php

change
'MENU_CATEGORIES_TO_SORT_BY_NAME' => 'reports,tools',
to
'MENU_CATEGORIES_TO_SORT_BY_NAME' => 'configuration,reports,tools',

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Dec 2024, 1:52 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Sort admin configuration menu

swguy:

OK. Edit admin/includes/languages/lang.english.php

change
'MENU_CATEGORIES_TO_SORT_BY_NAME' => 'reports,tools',
to
'MENU_CATEGORIES_TO_SORT_BY_NAME' => 'configuration,reports,tools',
Even better, so that you're not making a core-file change, create the file admin/includes/languages/english/extra_definitions/mysite_overrides.php that contains

$define = [
    'MENU_CATEGORIES_TO_SORT_BY_NAME' => 'configuration,reports,tools',
];
return $define;
17 Dec 2024, 10:59 PM
#6
cath avatar

cath

New Zenner

Join Date:
Jun 2006
Posts:
21
Plugin Contributions:
0

Re: Sort admin configuration menu

Hi, Lat9 - thanks for your time.

I created the following:

D:\SOFTWARE\xampp\htdocs\zencart6\MYADMIN\includes\languages\english\extra_definitions\mysite_overrides.php

which contains:

<?php
$define = [
    'MENU_CATEGORIES_TO_SORT_BY_NAME' => 'configuration,reports,tools',
];
return $define;

and it made no difference to the configuration menu.

Is there somewhere else that I should make changes?

I followed SWGuy's instructions and that worked, but I understand that it's bad practice to edit the core files.

17 Dec 2024, 11:54 PM
#7
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Sort admin configuration menu

I made the file MYADMIN\includes\languages\english\extra_defin itionslang.mysite_overrides.php
and it works.

On my sites I usually prefix my override file names with z to force them to load last eg lang.zbmh_overrides.php

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB