简体   繁体   English

在magento中显示货币代码和货币符号

[英]Show currency code and currency symbol in magento

Hi i am new to magento at very basic level.I am facing an issue regarding currency.Right now only the currency symbol is shown eg $50.But i want to show the currency name and currency code eg US $50 or A$50 to differentiate among different symbols. 嗨,我是非常基本级别的magento。我正面临一个关于货币的问题。现在只显示货币符号,例如$ 50.但我想显示货币名称和货币代码,例如US $ 50或A $ 50来区分不同的符号。 I have found that using the below way one can get the desired things Currency Code : 我发现使用以下方式可以获得所需的东西货币代码:

<?php echo $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode(); ?>

Currency Symbol : 货币符号:

<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>

But i cant understand where should i implent this.Currency converter is present in the header.I want that if user selects "USD" the price of each product display as "US $20".....Please help me to fix this 但是我不明白我应该在哪里实现这个。标题中存在转换。我希望如果用户选择“USD”,每个产品的价格显示为“US $ 20”.....请帮我解决这个问题

You can set this from admin :- 你可以从admin设置: -

Go to admin -> system -> Manage Currency ->symbols 转到管理员 - >系统 - >管理货币 - >符号

And set your code and symbol here. 并在此处设置您的代码和符号。

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

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