Question

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

Était-ce utile?

La solution

You can try this:

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

Autres conseils

Try like this

$customerAddress->getCountryModel()->getName()
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top