用户登录情况下,获取默认的地址信息
$addressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
if ($addressId){
$address = Mage::getModel('customer/address')->load($addressId);
$address->getData();
}
$res['defaultbilling'] = $customer->getDefaultBilling(); // ID
$res['defaultshipping'] = $customer->getDefaultShipping(); // ID
if ($res['defaultbilling'] && $res['defaultshipping']){
$res['defaultbilling'] = Mage::getModel('customer/address')->load($res['defaultbilling'])->getData();
$res['defaultshipping'] = Mage::getModel('customer/address')->load($res['defaultshipping'])->getData();
}