Jump to content

Product tab order in admin

Recommended Posts

How is it decided in what order the tabs are shown in Products Admin, or Orders admin?  I added a new tab after General but it is showing last.


General - Description - Orders - Pricing - Categories Options - etc..... - Venue Info

I want:

General - Venue Info - Description - Orders - Pricing - Categories Options - etc.....

Thanks for any and all help

Link to comment
Share on other sites

When the function call is made to add a tab, there is a parameter one can use to place it relative to other tabs.

The thing is, the standard tabs show up in context, in the order the function is called.

For example, in products.index.inc.php:

Near lines 666-667:
    $GLOBALS['main']->addTabControl($lang['common']['general'], 'general');
    $GLOBALS['main']->addTabControl($lang['common']['description'], 'description');

These two tabs will show only when adding/editing a product, and in this order.

Thus we can assume the array element order index (the 'key' to an array) will be 0 to start and gets assigned to 'general'. Next, the index will be 1 and gets assigned to 'description'.

The function call has these parameters:

$target = '', // the ID of the <div> with the content
$url = null,
$accesskey = null,
$notify_count = false,
$a_target = '_self',
$priority = null,
$onclick = ''

$GLOBALS['main']->addTabControl("Venue Info", 'venue', null,null,false,'_self',1,'');

The function will check if there is a tab already at priority=1, and if there is, add 0.01 to the priority passed in. Thus, when the array of tabs are ready for the template, a sorted array will put 'venue' (=1.01) after 'description' (=1).

Not specifying a priority has the effect of placing the tab 'in sequence', that is, after those tabs already added via the function call sans priority, but before any other tabs added via the function call sans priority. So, the sequence depends on when the hook got played.

Unless, as explained above, a priority value (greater than zero) is passed in.

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.

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