开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜