Can you Please guide how can I add new tab in admin side customer module with some custom attribute?
I create below files, But still not get anything, No tab added, Please check and correct me if anything goes wrong.
1) app/code/local/Customtab/CustomerAccount/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Customtab_CustomerAccount>
<version>0.1.0</version>
</Customtab_CustomerAccount>
</modules>
<adminhtml>
<layout>
<updates>
<customeraccount>
<file>customeraccount.xml</file>
</customeraccount>
</updates>
</layout>
</adminhtml>
<global>
<blocks>
<customeraccount>
<class>Customtab_CustomerAccount_Block</class>
</customeraccount>
</blocks>
</global>
</config>
2.) app/etc/modules/Customtab_Customeraccount.xml
<?xml version="1.0"?>
<config>
<module>
<Customtab_CustomerAccount>
<active>true</active>
<codePool>local</codePool>
</Customtab_CustomerAccount>
</module>
</config>
3.) app/code/local/Customtab/CustomerAccount/Block/Adminhtml/Customer/Edit/Tab/Action.php
<?php
/**
* Adminhtml customer insurance tab
*
*/
class Customtab_CustomerAccount_Block_Adminhtml_Customer_Edit_Tab_Action
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
public function __construct()
{
$this->setTemplate('customeraccount/action.phtml');
}
public function getCustomtabInfo(){
$customer = Mage::registry('current_customer');
$customtab='Custom tab insurance settings is here';
return $customtab;
}
/**
* Return Tab label
*
* @return string
*/
public function getTabLabel()
{
return $this->__('Insurance Settings');
}
/**
* Return Tab title
*
* @return string
*/
public function getTabTitle()
{
return $this->__('Insurance Tab');
}
/**
* Can show tab in tabs
*
* @return boolean
*/
public function canShowTab()
{
$customer = Mage::registry('current_customer');
return (bool)$customer->getId();
}
/**
* Tab is hidden
*
* @return boolean
*/
public function isHidden()
{
return false;
}
/**
* Defines after which tab, this tab should be rendered
*
* @return string
*/
public function getAfter()
{
return 'tags';
}
}
?>
4.) app/design/adminhtml/default/default/template/customeraccount/action.phtml
<div>
New Custom Tab
</div>
5.) app/design/adminhtml/default/default/layout/customeraccount.xml
customer_edit_tab_action customeraccount/adminhtml_customer_edit_tab_action
app/etc/module/Customtab_Customeraccount.xml
should beapp/etc/modules/Customtab_Customeraccount.xml