I have created a custom customer_address attribute using below script :
$installer = new Mage_Customer_Model_Entity_Setup('core_setup');
$installer->startSetup();
$installer->addAttribute('customer_address', 'country_code', array(
'type' => 'varchar',
'input' => 'text',
'label' => 'Country Code',
'global' => 1,
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'visible_on_front' => 1
));
Mage::getSingleton('eav/config')
->getAttribute('customer_address', 'country_code')
->setData('used_in_forms', array('customer_register_address','customer_address_edit','adminhtml_customer_address'))
->save();
$installer->endSetup();
and added it in billing.phtml as :
<input type="text" name="billing[country_code]" value="<?php echo $this->escapeHtml($this->getAddress()->getCountryCode()) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Country Code')) ?>" class="input-text required-entry " id="billing:country_code" />
But on order place other values saved in customer address but not custom attribute.
How to do that?