Admin – How to Remove Field in Customer Account Information

admincustomer

I am trying to remove the Associate to Website field on the following page:

Customers -> Manage Customers -> Click on a customer -> Account Information

I have checked Mage_Adminhtml_Block_Customer_Edit_Tab_Account::initForm() in this file:

app/code/local/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php

but I am unsure how it loads the fields and how to remove a field.

Best Answer

The fastest solution is in the file that you mentioned - app/code/local/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php in public function initForm() to comment/remove this lines:

$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$form->getElement('website_id')->setRenderer($renderer);

and below them to add:

$fieldset->removeField('website_id');
Related Topic