Possible way of getting address from checkout and make it default

56 Views Asked by At

i'm trying to get address from checkout page for a registered customer. on the checkout page I have a form that a user has to fill in with address info. Now the trick is to get that address displayed on the account dashboard.

I did try to get the address on the quote on .phtml here is my code

$quote = Mage::getSingleton('checkout/session')->getQuote();
$quote_billing = $quote->getBillingAddress();

echo $quote_billing

Is there any other possible way to get and address from a session

2

There are 2 best solutions below

0
On

You could also do what you did and just do getData() on the $quote_billing. That should provide you with the data that you need to pull.

0
On

Try:

$customer = Mage::getSingleton('customer/session')->getCustomer();

foreach ($customer->getAddresses() as $address) {
    Zend_Debug::dump($address->getData());
}