Adding extra field to registration form in Magento 1.9

I used this tutorial to add an extra field in Magento 1.9 to the registration form: http://www.fontis.com.au/blog/magento/know-more-about-your-customers-adding-custom-signup-attributes

Unfortunately, it doesn't work. I am new to Magento and need some help. I would take care of the step by step instructions on how to create a new module in order to be able to add this extra field to the current Magento 1.9 registration form.

+3


source to share


1 answer


Ok, I just did it, that's how. Go to http://www.silksoftware.com/magento-module-creator/ and use the Module Creator to create a new module called "YourCustomerAttribute".



  • Set "Add Client Attribute" to YES
  • Make the required inputs and selections as needed.
  • Be sure to select the forms in which you need the new attributes to be used.
  • Generate the module.
  • Upload the module to your Magento folder.
  • Change the location in app / design / frontend / base / default / template / persistent / customer / form / register.phtml and add:

     <div class="input-box">
     <label for="YourAttributeName"><?php echo $this->__('YourAttributeName') ?><span class="required">*</span></label><br />
     <input type="text" name="YourAttributeName" id="YourAttributeID" value="<?php echo $this->htmlEscape($this->getFormData()->getYourAttributeName()) ?>" title="<?php echo $this->__('YourAttributeName') ?>" class="required-entry input-text" />
    </div>
    
          

  • If you want the client to be able to change the attribute in the client panel, change the app / design / frontend / base / default / template / client / form / edit.phtm and add:

    <li>
        <label for="YourAttributeName" class="required"><em>*</em><?php echo $this->__('YourAttributeName') ?></label>
        <div class="input-box">
            <input type="text" name="YourAttributeName" id="YourAttributeID" value="<?php echo $this->escapeHtml($this->getCustomer()->getYourAttributeName()) ?>" title="<?php echo $this->__('YourAttributeName') ?>" class="input-text required-entry" />
        </div>
    </li>
    
          

  • Refresh all caches.

+14


source







All Articles