如何在用户登录时获取报价地址对象?

问题描述:

一个特定的用户从前端登录到他的账户并添加一些项目到购物车。然后他退出了。再次登录时,我想获取他的报价地址对象。如何在用户登录时获取报价地址对象?

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

您可以使用:

$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 

希望这有助于!