Magento – How to get the quote address object when user logged in

addressmagento-1.7quote

One particular user logged in to his account from frontend and adds some items to the shopping cart. And then he logged out. And again when he logged in I want to get his quote address object.

How to achieve this? Is there any event which fires and I can get the quote address object? Any suggestions will be appreciated.

Best Answer

To get a customer's default billing adress you can do the following:

<?php
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
$visitorData = Mage::getModel('customer/customer')->load($customerId);
$billingaddress = Mage::getModel('customer/address')->load($visitorData->default_billing);
$addressdata = $billingaddress ->getData();
$addressdata['street'];
$addressdata['city'];
$addressdata['postcode'];
$addressdata['region'];
$addressdata['telephone'];

var_dump($addressdata);