3

Customer Address in Admin Page:

enter image description here

In my checkout page,

enter image description here

Filled the fields and I placed the order,

enter image description here

After placed an order I checked in my backend,all the fields are saved correctly except taxvat field.

enter image description here

1
  • You have selected a new address, so check the new address added, not the default one. from your last image, check the one beneath, whose street address is "third street" and no second street address
    – MTM
    Jul 25 '14 at 14:06
3

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']);  

 }    
0

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());
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.