Sunday 24 June 2012

How to get customer address in magento

$customerAddressId = Mage::getSingleton('customer/customer')->load($_review->getCustomerId())->getDefaultBilling()


            if($customerAddressId)
            {
               $address = Mage::getModel('customer/address')->load($customerAddressId);
               $arrAddress = $address->getData();
               //$countryName = Mage::getModel('directory/country')->load($arrAddress['country_id'])->getName();
               $addressHtml = " (From ".$arrAddress['city'].", ".$arrAddress['region'].")";
               //echo "<pre>"; print_r($arrAddress);echo "</pre>"; die();
            }

If this helps, please like, share this website in Facebook.

No comments:

Post a Comment