How to return an array of billing addresses and shipping addresses in Magento?
Is there a way to make Magento return a PHP array of all shipping/billing addresses that the logged in user has us开发者_JAVA百科ed in the past?
There's no built in that will do what you want. You can, however, create such an array by grabbing the address collection.
Something like this
$all = array();
$customer = Mage::getModel('customer/session')->getCustomer();
foreach($customer->getAddressesCollection() as $address)
{
$all[] = $address;
//$all[] = $address->getData();
}
var_dump($all);
精彩评论