【问题标题】:Can't solve "Currency 'USD' not found" error无法解决“找不到货币'USD'”错误
【发布时间】:2012-07-16 22:01:35
【问题描述】:

我在前端和后端收到此消息:处理您的请求时出错。

当我删除缓存文件夹(var/cache、/tmp 和 /session)时,我让前端再次工作,直到我访问商店中的任何页面,其中包含价格。后端更难重新开始工作(现在不是)。

检查错误日志,我得到一大堆以“找不到货币'美元'”开头的错误日志。这一切都是在一些小改动之后开始发生的,包括我通过编辑 /lib/Zend/Locale/Data/es.xml (西班牙语规范)在这里:

  <currencyFormats>
    <currencyFormatLength>
     <currencyFormat>
        <pattern>¤ #,##0.00</pattern>
     </currencyFormat>
   </currencyFormatLength>
   <unitPattern count="other">{0} {1}</unitPattern>
 </currencyFormats>

我尝试恢复到以前的格式,然后将原始文件复制回来。肯定是别的什么地方坏了,我找不到。

这是错误日志中最后步骤的摘要(您需要全部吗?)

a:5:{i:0;s:24:"找不到货币'USD'";i:1;s:3740:"#0 /home/content/32/9343032/html/app/code /core/Mage/Core/Model/Locale.php(575): Zend_Currency->__construct('USD', Object (Zend_Locale))

#1 /home/content/32/9343032/html/app/code/core/Mage/Directory/Model/Currency.php(233):Mage_Core_Model_Locale->货币('EUR')

#2 /home/content/32/9343032/html/app/code/core/Mage/Directory/Model/Currency.php(216): Mage_Directory_Model_Currency->formatTxt(NULL, Array)

#3 /home/content/32/9343032/html/app/code/core/Mage/Directory/Model/Currency.php(197): Mage_Directory_Model_Currency->formatPrecision(NULL, 2, Array, true, false)

#4 /home/content/32/9343032/html/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php(82): Mage_Directory_Model_Currency->format(NULL)

请帮帮我...

谢谢 米格尔

【问题讨论】:

  • 顺便说一句:忘了提到更改是 ¤ #,##0.00#,##0.00 ¤Â。有趣的代码¤Â代表€符号。
  • 您是否真的在管理面板中更改了货币类型?它似乎在寻找美元货币。
  • udjamaflip,感谢您的回复。是的,货币从一开始就正确地更改为欧元。那是我的改变之一(有毒的?我不知道)。无论如何,由于我无法访问管理员,所以我决定更新到 1702(我有 1700)并刷新所有内容。它现在工作正常,我必须一一检查细节,以确保我对代码所做的所有小改动都正常(并且不会再次中断)。

标签: magento backend frontend


【解决方案1】:

清除缓存,从 var/session 中删除所有会话文件并刷新。

【讨论】:

    【解决方案2】:

    首先从管理面板检查您的 Magento 语言环境设置 系统->配置->

    常规->常规->区域设置选项 Locale // 检查选择了哪个选项。

    如果选项是英语(英国)

    请更新语言环境文件..或检查是否有可用的货币设置。

    转到 cpanel 并打开 magento 文件: lib/Zend/Locale/Data/en.xml

            <currency type="USD">
                <displayName>US Dollar</displayName>
                <displayName count="one">US dollar</displayName>
                <displayName count="other">US dollars</displayName>
                <symbol>$</symbol>
            </currency>
    

    或者您可以添加以下选项

    <numbers>
    
            <currencyFormats>
                <currencyFormatLength>
                    <currencyFormat>
                        <pattern>¤#,##0.00;(¤#,##0.00)</pattern>
                    </currencyFormat>
                </currencyFormatLength>
                <unitPattern count="one">{0} {1}</unitPattern>
                <unitPattern count="other">{0} {1}</unitPattern>
            </currencyFormats>
    
            add the below lines
    
             <currencies>
              <currency type="USD">
                    <displayName>US Dollar</displayName>
                    <displayName count="one">US dollar</displayName>
                    <displayName count="other">US dollars</displayName>
                    <symbol>$</symbol>
                </currency>
                <currency type="USN">
                    <displayName>US Dollar (Next day)</displayName>
                    <displayName count="one">US dollar (next day)</displayName>
                    <displayName count="other">US dollars (next day)</displayName> 
                </currency>
            </currencies>
    
        </numbers>
    

    在所有更改之后..请清除 magento 缓存..以正常工作所有更改

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-05
      • 2011-07-07
      • 1970-01-01
      • 2021-08-31
      • 2011-06-27
      • 1970-01-01
      • 2019-11-28
      • 1970-01-01
      相关资源
      最近更新 更多