Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - Adminhtml - Default website in new customer form

I am developing an online store for my customer and, we only have one website in our Magento setup.

In the admin panel when I go to Add a customer screen, in the "Associate to Website" field I see "Admin" selected by default. I would like to have my website there by default.

I think one possible way would be to write some code in: Mage_Adminhtml_Block_Customer_Edit_Tab_Account::initForm

like image 903
Ozair Kafray Avatar asked Feb 26 '23 06:02

Ozair Kafray


2 Answers

The cleanest way to do this is the just set the default value in your database. This will require no code changes at all.

UPDATE eav_attribute
SET default_value = 1
WHERE attribute_code = 'website_id'

The sample MySQL statement above sets your default website_id to 1.

like image 124
Scruffy Paws Avatar answered Mar 03 '23 19:03

Scruffy Paws


Or You can simply edit array in:

Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions()
like image 22
xyz Avatar answered Mar 03 '23 19:03

xyz