cancel
Showing results for 
Search instead for 
Did you mean: 

How to get default selected customer shipping address?

Highlighted
Contributor

How to get default selected customer shipping address?

How to get default selected customer shipping address?

if (is_null($this->_address)) {
if ($this->isCustomerLoggedIn()) {
$this->_address = $this->getQuote()->getShippingAddress();
} else {
$ship = $this->getQuote()->getShippingAddress();
$ship_country = $ship->getCountryId();
if(!empty($ship_country))
$this->_address = $ship;
else
$this->_address = Mage::getModel('sales/quote_address');
}
}


Please reply if you have any idea.

Thanks.

Tags (3)
1 REPLY
Occasional Contributor
Magento
Software Development

Re: How to get default selected customer shipping address?

Hi Ashish,

 

Isn't 

$this->getQuote()->getBillingAddress();

Working ?

 

Else let us know more details as to what you are trying to do.