How to get country name from country code?
magento
Solution
Magento stores the country names in locale files so that you can change the country name based on your language.
If you have the country code and you want to get the country name use the below code:
$country_name=Mage::app()->getLocale()->getCountryTranslation($country_code);
Or you can also try
// $countryCode looks like "US"
$country = Mage::getModel('directory/country')->loadByCode($countryCode);
echo $country->getName(); /
Please let me know if i can help you more.
Problem
``` $collection = Mage::getModel('custom/table')->getCollection(); ``` I have one custom table and there is one field country_code. Now I am passing this $collection to my javascript and using variables in that. Now I want to display country name instead of country code. Is there any way from which I can add country name in my collection using join query or any way else ? so before passing to js I want country name in my collection object.