Magento1 获取默认地信息

用户登录情况下,获取默认的地址信息

$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();
  }
默认的地址信息

Leave a comment

您的电子邮箱地址不会被公开。 必填项已用 * 标注