I need to add two fields for Customer in customer's registration. I managed to do it and its working fine for customer registration. But it is not getting saved in case of onepage checkout (if customer is trying to register himself at the time of checkout).
Below is my Code
Code for app\code\local\ComName\ModuleName\etc\config.xml
:
<?xml version="1.0"?>
<config>
<modules>
<ComName_ModuleName>
<version>0.1.0</version>
</ComName_ModuleName>
</modules>
<global>
<helpers>
<modulename>
<class>ComName_ModuleName_Helper</class>
</modulename>
</helpers>
<models>
<modulename>
<class>ComName_ModuleName_Model</class>
<resourceModel>modulename_mysql4</resourceModel>
</modulename>
</models>
<resources>
<customerattribute1417600661_setup>
<setup>
<module>ComName_ModuleName</module>
<class>Mage_Customer_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customerattribute1417600661_setup>
<customerattribute1417600661_write>
<connection>
<use>core_write</use>
</connection>
</customerattribute1417600661_write>
<customerattribute1417600661_read>
<connection>
<use>core_read</use>
</connection>
</customerattribute1417600661_read>
</resources>
</global>
</config>
Code for app\code\local\ComName\ModuleName\Helper\Data.php
:
class ComName_ModuleName_Helper_Data extends Mage_Core_Helper_Abstract
{
}
Code for app\code\local\ComName\ModuleName\sql\customerattribute1417600661_setup\mysql4-install-0.1.0.php
:
$installer = $this;
$installer->startSetup();
$installer->addAttribute("customer", "dri_license", array(
"type" => "varchar",
"backend" => "",
"label" => "Driving License",
"input" => "text",
"source" => "",
"visible" => true,
"required" => false,
"default" => "",
"frontend" => "",
"unique" => false,
"note" => ""
));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "dri_license");
$used_in_forms=array();
$used_in_forms[]="adminhtml_customer";
$used_in_forms[]="checkout_register";
$used_in_forms[]="customer_account_create";
$used_in_forms[]="customer_account_edit";
$used_in_forms[]="adminhtml_checkout";
$attribute->setData("used_in_forms", $used_in_forms)
->setData("is_used_for_customer_segment", true)
->setData("is_system", 0)
->setData("is_user_defined", 1)
->setData("is_visible", 1)
->setData("sort_order", 100)
;
$attribute->save();
$installer->endSetup();
I have added fields in billing.phtml
Please help me if anyone have any idea on what i missing