Step 1: app\etc\modules\Technooze_All.xml
<?xml version="1.0"?> <config> <modules> <Technooze_Customer> <active>true</active> <codePool>community</codePool> </Technooze_Customer> </modules> </config>
Step 2: app\code\community\Technooze\Customer\Block\Form\Register.php
<?php class Technooze_Customer_Block_Form_Register extends Mage_Customer_Block_Form_Register { protected function _prepareLayout() { $this->showAddressFields(); return parent::_prepareLayout(); } public function showAddressFields() { //customer_create_account_technooze_show_register_address $this->setShowAddressFields(Mage::getStoreConfig('customer/create_account/technooze_show_register_address')); } }
Step 3: app\code\community\Technooze\Customer\etc\config.xml
<?xml version="1.0"?> <config> <modules> <Technooze_Customer> <version>1.0.0</version> </Technooze_Customer> </modules> <global> <blocks> <class>Technooze_Customer_Block</class> <customer> <rewrite> <form_register>Technooze_Customer_Block_Form_Register</form_register> </rewrite> </customer> </blocks> </global> </config>
Step 4: app\code\community\Technooze\Customer\etc\system.xml
<?xml version="1.0"?> <config> <sections> <customer translate="label" module="customer"> <groups> <create_account translate="label"> <fields> <technooze_show_register_address translate="label"> <label>Enable Address Fields on Register</label> <frontend_type>select</frontend_type> <source_model>adminhtml/system_config_source_yesno</source_model> <sort_order>0</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </technooze_show_register_address> </fields> </create_account> </groups> </customer> </sections> </config>
Step 5: Goto Newly added config setting and enable address display at: admin / system / Configuration / Customers / Customer Configuration / Create New Account Options / Enable Address Fields on Register
Thats all!!!
There is an easy way too :). Just ignore step 4 and set true on step 2 as:
$this->setShowAddressFields(true);
Is there more easier way? Yes :)
Copy whole file FROM: app\code\core\Mage\Customer\Block\Form\Register.php
TO: app\code\local\Mage\Customer\Block\Form\Register.php
And add this line:
$this->setShowAddressFields(true);
on function _prepareLayout() before
return parent::_prepareLayout();
So, Which one do you prefer? First, Second or Third Option? Please comment with your view.
Also, Please like (+1) and follow us.
Implemented it on localhost first, to see if it causes any trouble. But it just works perfect. Thanks