Magento-默认发货地址与主发货地址

Magento-默认发货地址与主发货地址,magento,Magento,如果我以以下方式加载客户: $customer = Mage::getModel('customer/customer') ->load($customer_id); 这两者之间有什么区别 $customer -> getDefaultShippingAddress(); 及 提前谢谢 没有,因为getDefaultShippingAddress()在内部调用getPrimaryShippingAddress()。您可以在/app/code/local/Mage/Cust

如果我以以下方式加载客户:

$customer = Mage::getModel('customer/customer')
    ->load($customer_id);
这两者之间有什么区别

$customer -> getDefaultShippingAddress();


提前谢谢

没有,因为getDefaultShippingAddress()在内部调用getPrimaryShippingAddress()。您可以在/app/code/local/Mage/Customer/Model/Customer.php中自己检查代码

/**
 * Get default customer shipping address
 *
 * @return Mage_Customer_Model_Address
 */
public function getPrimaryShippingAddress()
{
    return $this->getPrimaryAddress('default_shipping');
}

/**
 * Get default customer shipping address
 *
 * @return Mage_Customer_Model_Address
 */
public function getDefaultShippingAddress()
{
    return $this->getPrimaryShippingAddress();
}
 /*
 * @return Mage_Customer_Model_Address
 */
public function getPrimaryBillingAddress()
{
    return $this->getPrimaryAddress('default_billing');
}

/**
 * Get customer default billing address
 *
 * @return Mage_Customer_Model_Address
 */
public function getDefaultBillingAddress()
{
    return $this->getPrimaryBillingAddress();
}

它们返回相同的结果

请参阅/app/code/core/Mage/Customer/Model/Customer.php

/**
 * Get default customer shipping address
 *
 * @return Mage_Customer_Model_Address
 */
public function getPrimaryShippingAddress()
{
    return $this->getPrimaryAddress('default_shipping');
}

/**
 * Get default customer shipping address
 *
 * @return Mage_Customer_Model_Address
 */
public function getDefaultShippingAddress()
{
    return $this->getPrimaryShippingAddress();
}
 /*
 * @return Mage_Customer_Model_Address
 */
public function getPrimaryBillingAddress()
{
    return $this->getPrimaryAddress('default_billing');
}

/**
 * Get customer default billing address
 *
 * @return Mage_Customer_Model_Address
 */
public function getDefaultBillingAddress()
{
    return $this->getPrimaryBillingAddress();
}