I used this tutorial: Add new field in magento(1.9) customer registration to add new custom field in magento.
But I want to show custom field in billing and shipping address. How to do this?
I used this tutorial: Add new field in magento(1.9) customer registration to add new custom field in magento.
But I want to show custom field in billing and shipping address. How to do this?
Ok. Lets Go to your "billing.phtml" file Which is Located at
frontend\rwd\default\template\persistent/checkout/onepage/billing.phtml
And Paste Following Code If You want to Checkbox Field.
<div class="field">
<input id="p_method_cashondelivery" value="cashondelivery" type="checkbox" name="cod" title="Cash On Delivery" onclick="<?php echo "checked!!!!";?>" class="checkbox" autocomplete="off">
<label for="p_method_cashondelivery">Cash On Delivery </label>
</div>
Same Way You Can Add Custom Field In Shipping Address File.
frontend\rwd\default\template\checkout/onepage/shipping.phtml
Please place this code too at end line of your installer code after the " $attribute->save();" function call.
$installer->run("
ALTER TABLE {$this->getTable('sales_flat_quote_address')} ADD COLUMN `license_number` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL AFTER `fax`;
ALTER TABLE {$this->getTable('sales_flat_order_address')} ADD COLUMN `license_number` VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL AFTER `fax`;
");
$installer->endSetup();