Tuesday 12 June 2012

How to add custom tab on customer left navigation tab through custom module


 Way to create a tab in customer tab in magento


First to create custom module,
Then to create the yourmodule.xml file on
path:app/design/adminhtml/default/default/layout
<layout version="0.1.0">
    <adminhtml_customer_edit>
        <reference name="customer_edit_tabs">
            <action method="addTab"><name>custmotab</name><block>yourmodulename/adminhtml_yourmodulename</block></action>
        </reference>
   </adminhtml_customer_edit>
</layout>

After then go to the yourmodulename.php file
Path:app/code/local/yournamespace/yourmodulename/Block/Adminhtml
implements the following class
Mage_Adminhtml_Block_Widget_Tab_Interface
Then to add following code after __construct() function
public function getTabLabel()
    {
        return $this->__('yourcustomtabname');
    }
public function getTabTitle()
    {
        return $this->__('yourcustomtabtitle');
    }

No comments:

Post a Comment