Monday 30 June 2014

How to get address collection of all customers in magento?

- To get all the address collection created by various customers in magento achieved by the following simple code,

$addressesCollection = Mage::getResourceModel('customer/address_collection');
$addressesCollection->addAttributeToSelect('*');
/* for particular address 
$addressesCollection->addFieldToFilter('id','12'); */

foreach ($addressesCollection as $address) {
echo "<pre>";
print_r($address->getData());
}

No comments:

Post a Comment