Magento 1.9 – Get Customer Billing Address Country ISO Code

billing-addresscountriescustomermagento-1.9

How can I get the country short code (ISO) of the billing address of a logged in customer. Can anyone help? Thanks!

Best Answer

You can try this:

$session = Mage::getSingleton('customer/session');
if ($session->isLoggedIn()) {
    $countryCode = $session->getCustomer()->getDefaultBillingAddress()->getCountry();
}