I wish to change the default order of tabs in Product Information when adding a new product. I want to put the Categories tab beneath the General tab (or even above it) - like here:
I'm struggling to figure out how to do this, as the majority of guides deal with custom tabs and thus allow you to use the after tags in the layout.xml file. From what I have found, editing the Tabs.php (app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php)
file is recommended by some - however; I tried to do this and it had no effect. Making the below code modification should have put the Catalog tab above the Inventory tab, but didn't:
$this->addTab('categories', array(
'label' => Mage::helper('catalog')->__('Categories'),
'url' => $this->getUrl('*/*/categories', array('_current' => true)),
'class' => 'ajax',
));
if (Mage::helper('core')->isModuleEnabled('Mage_CatalogInventory')) {
$this->addTab('inventory', array(
'label' => Mage::helper('catalog')->__('Inventory'),
'content' => $this->_translateHtml($this->getLayout()
->createBlock('adminhtml/catalog_product_edit_tab_inventory')->toHtml()),
));
(I know it's not ideal to edit core files, but I just wanted to test it.)
In any case, because I want the Categories tab beneath the General tab, I would need to edit this for loop which retrieves the user configurable tabs first no?
foreach ($groupCollection as $group) {
$attributes = $product->getAttributes($group->getId(), true);
// do not add groups without attributes
foreach ($attributes as $key => $attribute) {
if( !$attribute->getIsVisible() ) {
unset($attributes[$key]);
}
}
if (count($attributes)==0) {
continue;
}
$this->addTab('group_'.$group->getId(), array(
'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(),
'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)
->setGroupAttributes($attributes)
->toHtml()),
));
}
Any suggestions? Thanks!