Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where magento stores country full name

I have spent hours searching to find where magento stores full county name. We can get a full list of countries using this code:

$_countries = Mage::getResourceModel('directory/country_collection')
    ->loadData()
    ->toOptionArray(false);

This will return an array with country code and name, I investigated the directory module, and found out this call gets data from the table

directory_county

But this table don't have full county name! So where is it stored? and how is it retrieved using that call?

Thanks in advance.

like image 861
rramiii Avatar asked Feb 12 '23 10:02

rramiii


1 Answers

Ok so to compensate for my wrong answer. Here is how this works:

  1. /lib/Zend/Locale/Data/en.xml - if your store is in english, else another xml in the same directoery is read. Every country is there and its code under the xml tag <territory>

  2. The xml is cached using the Zend_Cache_Core class.

  3. /lib/Zend/Locale.php - function getTranslation invokes the lib/Zend/Cache/Core.php class to load from the cache.

Example: If you change the name of some country in en.xml and clear the magento cache. You will see the change when u invoke your code again.

like image 194
letsanov Avatar answered Feb 15 '23 11:02

letsanov