用户登录时如何获取引用地址对象?

时间:2013-11-04 16:19:27

标签: get magento-1.7 quote

一位特定用户从前端登录到他的帐户,并将一些商品添加到购物车。然后他退出了。再次登录时我想得到他的报价地址对象。

如何实现这一目标?是否有任何事件可以触发,我可以获得引用地址对象?

1 个答案:

答案 0 :(得分:0)

您可以使用:

$quote= Mage::getSingleton('checkout/session')->getQuote();//this will try to load the quote by current logged in customer if customer previously left any
$quote->getBillingAddress();//should return billng address object, if current quote has any billling address set
$quote->getShippingAddress();//should return shipping address object, if current quote has any shipping address set

希望这有帮助!