magentocustom-attribute

Magento Save Value in Custom Attribute of Customer from one page checkout (billing.phtml)


I have made one attribute for customer registration. It is working fine on registration. I am getting problem on one page checkout. Like normal registration, i am also taking value from customer during one step checkout registration but problem is that it doesn't store the value in attribute. thank you in advance code of billing.phtml which display textbox for attribute to take value from user

                    <li class="fields">
                       <div class="field">
                           <label for="<?php echo $attribute->getAttributeCode(); ?>" <?php if($attribute->getIsRequired()):?>class="required"><em>*</em> <?php  else :?>><?php endif;?><?php echo $this->__($frontEndLabel) ?></label>
                          <div class="input-box">

                               <?php if($attribute->getFrontendInput()== 'text'):?>
                                   <input type="text" name="billing[test]" id="billing:<?php echo $attribute->getAttributeCode(); ?>"  title="<?php echo $this->__($frontEndLabel); ?>" class="input-text <?php echo $fieldRequiredClass; ?> <?php echo $fieldFrontendClass ;?>"  />
                                  <?php endif ?>
                           </div>        
                        </div>

            <?php endif ?>
           <?php endforeach ?> 
           </li>

Solution

  • Just Update following code in your config.xml and check it

    <fieldsets>
        <checkout_onepage_quote>
            <attributename>
                <to_customer>*</to_customer>
            </attributename>
        </checkout_onepage_quote>
    </fieldsets>