Magento furnishes a straightforward client account information exchange page. Be that as it may, some online saves may need to gather significant client data for additional focused on and particular communications with their clients. A few illustrations of portions that could be gathered incorporate occupation, jobtitle etc…
I will exhibit the expansion of another custom field to the information exchange shape asking new clients to enter their occupation and jobtitle.
Here I saw you logically ordered proce
Step 1: Create file app/etc/modules/Jwd_Customer.xml
Add this code
<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Jwd_Customer> <codePool>local</codePool> <active>true</active> </Jwd_Customer> </modules> </config>
Step 2: Create files and folder app/code/local/Jwd/Customer/etc/config.xml
<?xml version="1.0"?> <config> <modules> <Jwd_Customer> <version>1.7.0.0</version> </Jwd_Customer> </modules> <global> <fieldsets> <customer_account> <occupation><create>1</create><update>1</update></occupation> <jobtitle><create>1</create><update>1</update></jobtitle> </customer_account> </fieldsets> <models> <Jwd_Customer> <class>Jwd_Customer_Model</class> </Jwd_Customer> </models> <helpers> <Jwd_Customer> <class>Jwd_Customer_Helper</class> </Jwd_Customer> </helpers> <resources> <customerattribute_setup> <setup> <module>Jwd_Customer</module> <class>Jwd_Customer_Model_Entity_Setup</class> </setup> </customerattribute_setup> </resources> </global> </config>
Step 3: Create files and folder app/code/local/Jwd/Customer/Model/Entity/Setup.php
<?php class Jwd_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup { public function getDefaultEntities(){ return array( 'occupation'=>array( 'type'=> 'static', 'label'=> 'Occupation', 'visiable' => true, 'required' => true, 'sort_order' => 80, ), 'jobtitle'=>array( 'type'=> 'static', 'label'=> 'Jobtitle', 'visiable' => true, 'required' => true, 'sort_order' => 80, ) ); } } ?>
Step 4: Create files and folder app/code/local/Jwd/Customer/sql/customerattribute_setup/mysql4-install-0.1.0.php
<?php $installer = $this; $installer->startSetup(); $installer->addAttribute('customer', 'occupation', array( 'label' => 'Occupation', 'visible' => 1, 'required' => 0, 'position' => 1, 'sort_order' => 80, )); $installer->addAttribute('customer', 'jobtitle', array( 'label' => 'Jobtitle', 'visible' => 1, 'required' => 0, 'position' => 1, 'sort_order' => 80, )); $installer->endSetup(); $customer = Mage::getModel('customer/attribute')->loadByCode('customer', 'occupation'); $forms= array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'); $customer->setData('used_in_forms', $forms); $customer->save(); $customer = Mage::getModel('customer/attribute')->loadByCode('customer', 'jobtitle'); $forms= array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'); $customer->setData('used_in_forms', $forms); $customer->save(); ?>
Look at below image how your registartion and other page look like.
Hope this article is helpful.
Magento Development | PSD To Magento | Magento Theme Development | Magento Development Services
Thanks for finally talking about > Expert Magento 2 Freelancers – Justwebdevelopment < Liked it!