magento存储国家全名的位置 [英] where magento stores country full name

查看:89
本文介绍了magento存储国家全名的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了数小时进行搜索,以查找magento存储完整县名的位置. 我们可以使用以下代码获取完整的国家/地区列表:

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

directory_county

但是此表没有完整的县名!那么它存储在哪里呢? 以及如何使用该调用来检索它?

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

谢谢.

推荐答案

好的,以弥补我的错误回答.这是这样的:

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

  1. /lib/Zend/Locale/Data/en.xml-如果您的商店是英语,则将读取同一目录中的另一个xml.每个国家都有,其代码在xml标签下<territory>

使用Zend_Cache_Core类缓存xml.

The xml is cached using the Zend_Cache_Core class.

/lib/Zend/Locale.php-函数getTranslation调用lib/Zend/Cache/Core.php类 从缓存加载.

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

示例:如果您在en.xml中更改了某个国家的名称并清除了magento缓存.当您再次调用代码时,您将看到更改.

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.

这篇关于magento存储国家全名的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆