Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to read/load Customer Attribute? 
 
shuron
Member
 
Avatar
Total Posts:  58
Joined:  2007-12-09
 

Hi everybody…

I need to modify PDF Invoice. I need to add customers Tax-Vat-Number

So i did figured out how to load a customer date (which I need to)

$customer Mage::getModel('customer/customer')->load($order->getCustomerId());

But now I don’t know how to load Attribute ‘taxvat’ for this.

The only what I could figure out is that values are stored in: customer_entity_varchar table not in a customer_entity..

Please help!

 
Magento Community Magento Community
Magento Community
Magento Community
 
somesid
Sr. Member
 
Total Posts:  83
Joined:  2008-06-20
 

Once you loaded your customer, if you do a var_dump($customer) you will see you’ve got an object containing an array called _data.

To get any field from the data (once it’s loaded), just call your field following this pattern $object->getMyField(); in your case :

$customer->getTaxvat();
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top