Get an array of billing addresses and shipping addresses in Magento
Jun 21, 2013, by admin
Magento has no built in function to get an array of all shipping or billing addresses. However, you can do this by creating such an array by grabbing the address collection. Something likes this
- $all_data = array();
- $customer = Mage::getModel(‘customer/session’)->getCustomer();
- foreach($customer->getAddressesCollection() as $customer_address)
- {
- $all_data[] = $customer_address;
- }
- var_dump($all_data);