Can't solve “Currency 'USD' not found” error

我的梦境 提交于 2019-12-12 05:31:38

问题


I'm getting this message at the frontend and the backend: There has been an error processing your request.

When I delete the cache folders (var/cache, /tmp & /session) I get the frontend working again until I visit any page in the store with a price in it. The backend is harder to get working again (it isn't right now).

Checking the error logs I get a whole bunch of them starting with "Currency 'USD' not found". This all started happening after a few minor changes including changing the order of the currency code from "$ 100.00" to "100,00 €" which I did by editing /lib/Zend/Locale/Data/es.xml (the spanish language specification) here:

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

I tried returning to the previous format and then copying the original file back. Something else must have broken somewhere and I can't find it.

Here is a summary of the last steps in the Error logs (do you need them all?)

a:5:{i:0;s:24:"Currency 'USD' not found";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->currency ('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)

Please help me out here...

Thanks Miguel

|improve this question

回答1:


Clear cache, remove all session file from var/session and refresh.




回答2:


First check your Magento Locale setting from admin panel system->configuration->

General->General->Locale Option Locale // check what option is selected.

if option is english(United Kingdon)

Please update the locale file..or check if there are currency setting is available.

Go to cpanel and open magento file : 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>

OR YOU CAN ADD the option below

<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>

after all the changes.. please clear the magento cache..to work all changes properly



来源:https://stackoverflow.com/questions/11513229/cant-solve-currency-usd-not-found-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!