Get customer billing address country short code (ISO Code)
-
10-10-2020 - |
Pergunta
How can I get the country short code (ISO) of the billing address of a logged in customer. Can anyone help? Thanks!
Solução
You can try this:
$session = Mage::getSingleton('customer/session');
if ($session->isLoggedIn()) {
$countryCode = $session->getCustomer()->getDefaultBillingAddress()->getCountry();
}
Outras dicas
Try like this
$customerAddress->getCountryModel()->getName()
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange