How do I change the currency symbol in Magento 1.5.1.0?

妖精的绣舞 提交于 2020-01-01 19:34:49

问题


I'm trying to change the price format in Magento ver. 1.5.1.0 from €8.49 to EUR 8.49

I have been looking through lots of posts and forums but it didn't work out. I tried to follow the instructions but it didn't work out so far. Cache is deactivated.

/lib/Zend/Locale/Data/en.xml
<currency type="EUR">
 <displayName>Euro</displayName>
 <displayName count="one">euro</displayName>
 <displayName count="other">euros</displayName>
 //added <symbol>EUR</symbol> here
</currency>

/lib/Zend/Locale/Data/root.xml
<currency type="EUR">
  <symbol>€</symbol> => changed to <symbol>EUR</symbol> didn't work
</currency>

And no, i don't want to change the core /Zend files or use str_replace.

Thanks for your help!


回答1:


Try to grep in your version root and you'll see that it is locale based so you just might need to change t in multiple files.

grep 'type="EUR"' . -rsn

don't forget to clear cache afterwards before observing the changes in front-end

rm -rf var/cache/* 



回答2:


  1. You can use free extension Currency Manager

  2. Or you can write your own simple module and override function format() in Mage_Directory_Model_Currency model.

    public function formatTxt($price, $options=array())
    {
        $options['display'] = Zend_Currency::USE_SHORTNAME;
        return parent::formatTxt($price, $options);
    }
    

P.S. You can loose your changes in /lib/Zend/Locale/Data/*.xml files after Magento upgrade.



来源:https://stackoverflow.com/questions/7281131/how-do-i-change-the-currency-symbol-in-magento-1-5-1-0

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