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

有帮助吗?

解决方案

You can try this:

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

其他提示

Try like this

$customerAddress->getCountryModel()->getName()
许可以下: CC-BY-SA归因
scroll top