On the following page:

Customers -> Manage Customers -> Click on a customer

It shows a list of tabs on the left side, one of which is called "Customer View".

But when I look at Mage_Adminhtml_Block_Customer_Edit_Tabs::_beforeToHtml, I see that the function call to addTab() is commented out for the "Customer View" tab.

So where is the Customer View tab being added from?


This block comes from layout xml. Goto "app/design/adminhtml/default/default/layout/customer.xml" and look "adminhtml_customer_edit" handler. Code sample look like;

<block type="adminhtml/customer_edit_tabs" name="customer_edit_tabs">
            <block type="adminhtml/customer_edit_tab_view" name="customer_edit_tab_view" template="customer/tab/view.phtml">
                <block type="adminhtml/customer_edit_tab_view_sales" name="sales" template="customer/tab/view/sales.phtml" before="-" />
                <block type="adminhtml/customer_edit_tab_view_accordion" name="accordion" />
            <action method="addTab"><name>customer_edit_tab_view</name><block>customer_edit_tab_view</block></action>

Goto "app/design/adminhtml/default/default/template/customer/tab/view.phtml" This template is responsible for content.

  • Thanks, I opened that template file and found the block associated with it, opened that and found a getTabLabel function. This still doesn't really tell me how the first tab in the tab list gets created, as I was looking to remove the first, but I think I will now just remove the second tab and rename the first. – Mex Feb 9 '15 at 23:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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