简体   繁体   English

Magento:如何在总计后显示货币代码?

[英]Magento: How To Display Currency Code After All Totals?

My question is very similar to this one on SO, only it doesn't exactly help me because it talks about replacing the currency symbol in front of the price and not displaying something after it. 我的问题是非常相似, 这一项上的,所以只有它不完全帮助我,因为它谈论有关更换货币符号的价格前,后不显示的东西。

What I would like to do is display after totals on the checkout, cart and other pages like that the price in this format: $232.00 AUD - the price will always have AUD on the end as it is an Australian run store. 我想做的是在结帐,购物车和其他页面上总计后显示,这种格式的价格是:$ 232.00 AUD-由于这是一家澳大利亚经营的商店,价格最后总是会有AUD。

Is there an easy way of doing this without having to edit multiple templates and resort to hacky conditional if statements? 有没有一种简单的方法,而无需编辑多个模板并诉诸于有条件的if语句呢?

If your prices always ends with ".00" you can use CurrencyManager module from related topic answer. 如果您的价格始终以“ .00”结尾,则可以使用相关主题答案中的CurrencyManager模块。 In this case you can set option "Cut Zero Decimals" to "Yes", and option "Replaces Cuted Zero Decimals" to ".00 AUD". 在这种情况下,您可以将“剪切零小数”选项设置为“是”,将“替换可爱的零小数”选项设置为“ .00 AUD”。

If you have cents in your prices you need to change 如果您的价格中包含美分,则需要更改

 public function formatTxt($price, $options=array()

in /app/code/community/ET/CurrencyManager/Model/Currency.php if you will use this module, or rewrite this original function in core (/app/code/core/Mage/Directory/Model/Currency.php) by own module. 如果要使用此模块,请在/app/code/community/ET/CurrencyManager/Model/Currency.php中,或通过以下方式在core(/app/code/core/Mage/Directory/Model/Currency.php)中重写此原始功能自己的模块。

Formats are defined in zend framework locale xml files so to change the format you need to edit one of these files in /lib/Zend/Locale/Data/*.xml and for Australia you are interested in en_AU.xml where you can specify the format you need. 格式是在zend Framework语言环境xml文件中定义的,因此要更改格式,您需要在/lib/Zend/Locale/Data/*.xml编辑这些文件之一,而对于澳大利亚,您对en_AU.xml感兴趣,您可以在其中指定您需要的格式。

see How do I change the currency symbol in Magento 1.5.1.0? 请参阅如何在Magento 1.5.1.0中更改货币符号? and read the comments as well 并阅读评论

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM