B-219 Sec-55 Noida, India
+918010221733

Add Custom Field in Registration Form and in Admin Side

Here I am add the Custom Field for the Customer Registration Form using the database,

It’s very simple to add Custom Field in Registration Form and also in Manage Customer Account Information of Admin,

This is the easiest way to Create field using Database Query !!!!!

A) First, Open your Database of Magento

    Click on SQL tab of  your Database and simplly write Below Query in that

    1)  Insert into eav_attribute set      entity_type_id=”1″,attribute_code=”occupation”,
backend_type=”text”,frontend_input=”text”,
frontend_label=”Occupation”,is_required=0,is_user_defined=0,is_unique=0

   2) Copy the Last inserted Id of  “Eav_attribute” table

   3)  Insert into `eav_entity_attribute` set entity_type_id=1,attribute_set_id=1, attribute_group_id=1,attribute_id=134,sort_order=111

   Here, you mention that change your attribute id with the Last inserted id of Eav_attribute table.

   attribute_id = “Last Inserted Id of Eav_attribute” table

   4) insert into  `customer_eav_attribute` set attribute_id=”134″,is_visible=1,multiline_count=1,is_system=0,sort_order=111

  same as Point (3) change attribute_id

  5) insert into  `customer_form_attribute` set form_code=”adminhtml_customer”,attribute_id=134

 same as Point (3) change attribute_id

  6) insert into  `customer_form_attribute` set form_code=”checkout_register”,attribute_id=134

  same as Point (3) change attribute_id

 7) insert into  `customer_form_attribute` set form_code=”customer_account_create”,attribute_id=134

 same as Point (3) change attribute_id

8) insert into  `customer_form_attribute` set form_code=”customer_account_edit”,attribute_id=134

 same as Point (3) change attribute_id

B) Now, some code for Create Field to saw in Front end,

   1) open Customer/Form/registration.phtml

   simply Copy-Paste below code

 Copy this …….

   <li>
        <label for=”occupation”><em></em><?php echo $this->__(‘Occupation’) ?></label>

        <div class=”input-box”>

         <input type=”text” name=”occupation” id=”occupation” value=”<?php echo $this->htmlEscape($this->getCustomer()->getOccupation()) ?>” title=”<?php echo $this->__(‘Occupation’) ?>” class=”input-text” />

         </div>
    </li>

   2) open Customer/Form/edit.phtml

    simply Copy-Paste below code

    Copy this …….

   <li>
        <label for=”occupation”><em></em><?php echo $this->__(‘Occupation’) ?></label>

        <div class=”input-box”>

         <input type=”text” name=”occupation” id=”occupation” value=”<?php echo $this->htmlEscape($this->getCustomer()->getOccupation()) ?>” title=”<?php echo $this->__(‘Occupation’) ?>” class=”input-text” />

         </div>
    </li>

(Visited 116 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.