5

I'm looking to add a new tab to the adminhtml catalog product edit page on the left side. I've gone through and followed this tutorial, and my new tab is showing up correctly on the left side.

http://www.phpcmsframework.com/2012/12/magento-steps-to-add-custom-tabs-to.html

What I'm looking to do now, though, is change the sorting order of those tabs so mine is not last on the list. This is something that was not covered in the tutorial, and I have not been able to find anything online or in the code to point me in the right direction. Any suggestions appreciated!

1 Answer 1

10

See below, notice I changed the action from addTab to addTabAfter and within the action I added the node <after>inventory</after>

This will display the tab under the Inventory tab.

As per the example, your layout is currently:

<?xml version="1.0"?>
<layout>
    <adminhtml_catalog_product_edit>
        <reference name="product_tabs">
            <action method="addTab">
                <name>my_custom_tab</name>
                <block>customtabs/adminhtml_catalog_product_tab</block>
            </action>
        </reference>
    </adminhtml_catalog_product_edit>
</layout>

Change it to this:

<?xml version="1.0"?>
<layout>
    <adminhtml_catalog_product_edit>
        <reference name="product_tabs">
            <action method="addTabAfter">
                <name>my_custom_tab</name>
                <block>customtabs/adminhtml_catalog_product_tab</block>
                <after>inventory</after>
            </action>
        </reference>
    </adminhtml_catalog_product_edit>
</layout>
1
  • This worked perfectly. Thank you for providing such a clear and concise answer! Commented May 6, 2015 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.