简体   繁体   中英

How to add new custom field in Magento 1 customer address

We have tried this answer its all working good for customer edit form, but now the issue is,

we have used magestore onestepcheckout,

also we have added

<li>
                <div class="one-field">
                    <input onkeyup="validateElement(this.id)" type="text"
                               title="<?php echo Mage::helper('core')->quoteEscape($this->__('Govt ID')) ?>"
                               name="billing[govt_id]" id="billing:govt_id"
                               value="380051"
                               class="input-text"
                               required/>
                    <span class="highlight"></span>
                    <span class="bar"></span>
                    <label class="required" for="billing:govt_id"><?php echo $this->__('Govt ID') ?> <em>*</em></label>
                </div>
            </li>

also, we have added,

'govt_id' => Mage::helper('onestepcheckout')->__('Govt Id'),

in the position.php page

but, know while time of billing value of this newly added govt_id is not being saved.

For add new address field, you need to create a new extension.

Here, Step-by-step guide for add Govt Id in customer address: http://excellencemagentoblog.com/blog/2011/11/29/magento-adding-custom-field-to-customer-address/

Hope it helps you:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM