Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6944437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:18:24+00:00 2026-05-27T13:18:24+00:00

I am developing a website with magento ver-1.6. I am try to create new

  • 0

I am developing a website with magento ver-1.6. I am try to create new fields for customer registration, but it not created. I followed the same way what we followed in ver-1.5.

Any variation in create customer fields in 1.6?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:18:25+00:00Added an answer on May 27, 2026 at 1:18 pm

    I don’t know what you tried so I’m just going to list all the steps needed to add a new schooL customer attribute to the Magento 1.6.1 registration form.

    1. Create a module preferably, or place similiar code to this in some .phtml file and run it once. If you’re doing this proper and creating a module, put code like this into the mysql_install file:

      <?php
      $installer = $this;
      $installer->startSetup();
      $setup = Mage::getModel('customer/entity_setup', 'core_setup');
      $setup->addAttribute('customer', 'school', array(
          'type' => 'int',
          'input' => 'select',
          'label' => 'School',
          'global' => 1,
          'visible' => 1,
          'required' => 0,
          'user_defined' => 1,
          'default' => '0',
          'visible_on_front' => 1,
              'source'=> 'profile/entity_school',
      ));
      if (version_compare(Mage::getVersion(), '1.6.0', '<='))
      {
            $customer = Mage::getModel('customer/customer');
            $attrSetId = $customer->getResource()->getEntityType()->getDefaultAttributeSetId();
            $setup->addAttributeToSet('customer', $attrSetId, 'General', 'school');
      }
      if (version_compare(Mage::getVersion(), '1.4.2', '>='))
      {
          Mage::getSingleton('eav/config')
          ->getAttribute('customer', 'school')
          ->setData('used_in_forms', array('adminhtml_customer','customer_account_create','customer_account_edit','checkout_register'))
          ->save();
      }
      $installer->endSetup();
      ?>
      
    2. In your module config.xml file. Note that the name of my module is Excellence_Profile.

      <profile_setup> <!-- Replace with your module name -->
       <setup>
        <module>Excellence_Profile</module> <!-- Replace with your module name -->
        <class>Mage_Customer_Model_Entity_Setup</class>
       </setup>
      </profile_setup>
      
    3. Here we will add our attribute, to the customer registration form. In version 1.6.0(+) the phtml file used is persistance/customer/register.phtml and in version 1.6.0(-) the phtml file used is customer/form/register.phtml
      So we need to open the phtml file, based on magento version and add this code in the tag.

      <li>
      <?php
      $attribute = Mage::getModel('eav/config')->getAttribute('customer','school');
      ?>
      <label for="school" class="<?php if($attribute->getIsRequired() == true){?>required<?php } ?>"><?php if($attribute->getIsRequired() == true){?><em>*</em><?php } ?><?php echo $this->__('School') ?></label>
      <div class="input-box">
      <select name="school" id="school" class="<?php if($attribute->getIsRequired() == true){?>required-entry<?php } ?>">
      <?php
      $options = $attribute->getSource()->getAllOptions();
      foreach($options as $option){
      ?>
      <option value='<?php echo $option['value']?>' <?php if($this->getFormData()->getSchool() == $option['value']){ echo 'selected="selected"';}?>><?php echo $this->__($option['label'])?></option>
      <?php } ?>
      </select>
      </div>
      </li>
      
    4. For magento 1.4.2(+) that is all that is required for the registration step. If you create a user from here, you should see the school text field in admin.
      For magento 1.4.1(-), we need to do another thing open the your modules config.xml file and add:

      <global>
              <fieldsets>
                  <customer_account>
                       <school><create>1</create><update>1</update><name>1</name></school>
                  </customer_account>
              </fieldsets>
      </global>
      
    5. Once, user has created his account in the MyAccount->Account Information section he should be able to edit the school field as well. For this open the phtml file customer/form/edit.phtml and put in the code in the :

      <?php
      <li>
      <?php
      $attribute = Mage::getModel('eav/config')->getAttribute('customer','school');
      ?>
      <label for="is_active" class="<?php if($attribute->getIsRequired() == true){?>required<?php } ?>"><?php if($attribute->getIsRequired() == true){?><em>*</em><?php } ?><?php echo $this->__('School') ?></label>
      <div class="input-box">
      <select name="school" id="school" class="<?php if($attribute->getIsRequired() == true){?>required-entry<?php } ?>">
      <?php
      $options = $attribute->getSource()->getAllOptions();
      foreach($options as $option){
      ?>
      <option value='<?php echo $option['value']?>' <?php if($this->getCustomer()->getSchool() == $option['value']){ echo 'selected="selected"';}?>><?php echo $this->__($option['label'])?></option>
      <?php } ?>
      </select>
      </div>
      </li>
      
    6. A registration form also shows up at the checkout page in magento. To add you field here, you need to edit checkout/onepage/billing.phtml for magento version 1.6(-) and persistant/checkout/onepage/billing.phtml for magento version 1.6(+) file and then find the code:

      <?php if(!$this->isCustomerLoggedIn()): ?>
      

      inside this if condition add your field

      <li>
      <li>
      <?php
      $attribute = Mage::getModel('eav/config')->getAttribute('customer','school');
      ?>
      <label for="school" class="<?php if($attribute->getIsRequired() == true){?>required<?php } ?>"><?php if($attribute->getIsRequired() == true){?><em>*</em><?php } ?><?php echo $this->__('School') ?></label>
      <div class="input-box">
      <select name="billing[school]" id="school" class="<?php if($attribute->getIsRequired() == true){?>required-entry<?php } ?>">
      <?php
      $options = $attribute->getSource()->getAllOptions();
      foreach($options as $option){
      ?>
      <option value='<?php echo $option['value']?>'><?php echo $this->__($option['label'])?></option>
      <?php } ?>
      </select>
      </div>
      </li>
      

      Next open your module config.xml or any other config.xml file, add the following lines:

          <global>
           <fieldsets>
             <checkout_onepage_quote>
               <customer_school>
                   <to_customer>school</to_customer>
               </customer_school>
             </checkout_onepage_quote>
              <customer_account>
                  <school>
                      <to_quote>customer_school</to_quote>
                  </school>
              </customer_account>
            </fieldsets>
          </global>
      
    7. Next we need to make some changes in the quote table i.e sales_flat_quote table in magento. If you have a module then create an upgrade version of your sql file and put in this code:

      $tablequote = $this->getTable('sales/quote');
      $installer->run("
      ALTER TABLE  $tablequote ADD  `customer_school` INT NOT NULL
      ");
      

    After doing this make sure to clear you magento cache, specifically “Flush Magento Cache” and “Flush Cache Storage”.
    Now when you place order, the customer is created with the correct school attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm considering developing a website similar to stackoverflow, but the answers may also consist
I am developing a Ecommerce website by using version Magento 1.6. I need to
I'm developing a website, but stuck at some point, where i needed to detect
I am developing a website(web forms , not MVC) in VS 2008(with SP1 ).I
I'm currently developing a website that should also work on mobile devices. But since
I am developing a Magento Website and I am getting an error in IE7+8
All this guildes and books are aimed at developing website, but what if I
Currently I am developing website in asp.net. I wanted to include spellchecker module into
Developing a website and just trying to get back into the swing of (clever)
I am developing a website that relies much on XML data. The web site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.