0
votes

I am new in Magento. I want to add more fields in onepage checkout billing and shipping address.

I have followed this Link

http://excellencemagentoblog.com/magento-adding-custom-field-to-customer-address

But its not working for me.

1

1 Answers

1
votes

if you are using magento versions 1.6 above than you can copy "billing.phtml" from "app\design\frontend\base\default\template\persistant\checkout\onepage" to "app\design\frontend\default\your_theme\template\persistant\checkout\onepage".Then you have to add your custom fileds in it.

Find <?php if ($this->canShip()): ?> this line in your billing.phtml and add your code above it. For eg:

<li class="fields">
    <div class="field">
    <label for="billing:suburb" class="required"><em>*</em><?php echo $this->__('Suburb/Postcode') ?></label>
    <div class="input-box">

        <input type="text" id="suburbs" name="custom" value="<?php echo $this->htmlEscape($this->getQuote()->getSuburb()) ?>" title="<?php echo $this->__('Suburb') ?>" class="input-text required-entry" id="billing:suburb" />
       <button type="button" id="driver" title="<?php echo $this->__('Click me!') ?>" class="button" ><span><span><?php echo $this->__('Click me!') ?></span></span></button>
    </div>
</div>    

I have added a text field and a button.You can see it in frontend.

Now for adding custom fields in shipping information all the above process are almost same,just find shipping .phtml in "app\design\frontend\base\default\template\checkout\onepage\" and create a same folder structure in yuour theme folder and paste it there. Add you fields there.

Hope this will help.