I have a question for my magento version 1.9.3.6, I create a module to add a custom field in Customer Registration Form and Checkout Registration Form.
config.xml
<?xml version="1.0"?>
<config>
<modules>
<Webcomnet_Field>
<version>1.0.0</version>
</Webcomnet_Field>
</modules>
<global>
<helpers>
<field>
<class>Webcomnet_Field_Helper</class>
</field>
</helpers>
<models>
<field>
<class>Webcomnet_Field_Model</class>
<resourceModel>field_mysql4</resourceModel>
</field>
</models>
<resources>
<customerattribute1550847105_setup>
<setup>
<module>Webcomnet_Field</module>
<class>Mage_Customer_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customerattribute1550847105_setup>
<customerattribute1550847105_write>
<connection>
<use>core_write</use>
</connection>
</customerattribute1550847105_write>
<customerattribute1550847105_read>
<connection>
<use>core_read</use>
</connection>
</customerattribute1550847105_read>
</resources>
</global>
</config>
install code:
<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute("customer", "cod_univoco", array(
"type" => "varchar",
"backend" => "",
"label" => "Codice Univoco",
"input" => "text",
"source" => "",
"visible" => true,
"required" => false,
"default" => "",
"frontend" => "",
"unique" => false,
"note" => ""
));
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", "cod_univoco");
$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();
Then I edited the files "register.phtml" to show the field in registration form, the file "form/edit.phtml" to show the field in edit form in customer account section and the file "billing.phtml" to show the field in checkout registration form.
The module works fine for the customer registration form and the edit form, the problem is in the checkout form, the field appear but if I insert a value that value is not saved.
What can I do? Thanks