如何在Magento中返回一组帐单邮寄地址和送货地址?

时间:2011-01-20 08:54:58

标签: php magento

有没有办法让Magento返回已登录用户过去使用的所有送货/帐单地址的PHP数组?

1 个答案:

答案 0 :(得分:1)

没有内置可以做你想要的。但是,您可以通过抓取地址集来创建这样的数组。

像这样的东西

    $all = array();
    $customer = Mage::getModel('customer/session')->getCustomer();
    foreach($customer->getAddressesCollection() as $address)
    {
            $all[] = $address;
            //$all[] = $address->getData();
    }
    var_dump($all);
相关问题