Customer Address in Admin Page:
In my checkout page,
Filled the fields and I placed the order,
After placed an order I checked in my backend,all the fields are saved correctly except taxvat field.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityCustomer Address in Admin Page:
In my checkout page,
Filled the fields and I placed the order,
After placed an order I checked in my backend,all the fields are saved correctly except taxvat field.
Override core module Mage_Checkout_Model_Type_Onepage
In onepage.php
file,
public function saveBilling($data, $customerAddressId)
{
After this,
$address->implodeStreetAddress();
Add the line,
$address->setVatId($data['taxvat']);
}
I was having the same problem. It is a mistake made in the template file.
Open the file \app\design\adminhtml\default\default\template\customer\tab\addresses.phtml
There is the following code block (depending on version it may vary):
<?php
$this->getForm()->addValues($_address->getData())
->setHtmlIdPrefix("_item{$_address->getId()}")
->setFieldNameSuffix('address['.$_address->getId().']');
$this->addValuesToNamePrefixElement($_address->getPrefix())
->addValuesToNameSuffixElement($_address->getSuffix());
?>
What is needed to correct the problem is to change the call of "addValues" to "setValues". This will prevent leaving the old data in the new form by overriding the null/notset values.
So change to this:
<?php
$this->getForm()->setValues($_address->getData())
->setHtmlIdPrefix("_item{$_address->getId()}")
->setFieldNameSuffix('address['.$_address->getId().']');
$this->addValuesToNamePrefixElement($_address->getPrefix())
->addValuesToNameSuffixElement($_address->getSuffix());
?>