0

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.

Raviranjan Mishra
  • 849
  • 2
  • 11
  • 26

1 Answers1

1

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.

Navin Bista
  • 1,988
  • 2
  • 21
  • 37
  • 4
    And how these fields are going to get store in backend. I'm pretty much sure that mere display of these fields is not intended. – Prateek Aug 22 '14 at 08:53
  • You can add text, drop down and checkbox using this third party extension as well - http://www.fmeextensions.com/magento-additional-checkout-attributes-fields.html –  Apr 06 '15 at 12:15
  • 1
    @user2434 trying to make a sale, eh? – NotJay Sep 28 '15 at 17:19