Get country name from country code in magento
Posted by navaneeth on May 22, 2015 in Magento | No comments yet
![Get country name from country code in magento](https://i0.wp.com/navaneeth.me/wp-content/uploads/2015/05/get-country-name-from-country-code-in-magento.png?fit=584%2C259&ssl=1)
When dealing with magento customization sometimes we need to get country name from country code. Its pretty easy to do so with a single line of code
Magento has a model to manage the countries which is directory/country
So first we need to load the model with the desired country code as shown below
<?php echo Mage::getModel("directory/country")->load('in')->getName(); ?>
Hope this helps to get country name from country code in magento
Leave a Reply