0

I updated a project from Magento 1.5 to Magento 1.7.0.2. In the latest Mage CE Version we have vat_id attribute in customer_address. During checkout this field is used to validate a customer for 0% tax calculation. This all works fine.

Strange thing however is that when var_dumping customer_address_entity the vat_id field is not present. The other vat_* related fields are however.

I need the field to update the data in addresses for existing customers that have an old customer_entity related taxvat attribute value.

Anyone an idea on how I can access the vat_id field or where it even is?

1

Customer is an EAV model, so check wether isPartialLoad if yes, then you need to load the vat_id.

There are the ugly, bad, don't do it way:

$customer->load($customer->getId())

Or the clean way:

Search the function and the setting what makes the attribute to be loaded :) Change it and everything is fine. If the customer is fully loaded, something is wrong.

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.