Magento 四舍五入货币转换
我必须保留美元作为基础货币才能启用 PayPal,但我保留默认显示货币为 INR。现在每美元 45 卢比的兑换率给了我令人讨厌的十进制 INR 价格,我想摆脱它,Magento 必须使用某种函数将价格从基础货币转换为 INR,同时在各处显示 INR 价格,该函数是什么以及我怎样才能修改它以始终给出舍入值?
我发现:
$price = Mage::helper('directory')->currencyConvert($tax->getPrice($product, $product->getFinalPrice(), false), $fromCur, $toCur);
这是 Magento 本身用来转换不同货币价格的函数吗?如果它是在哪里定义的?
I have to keep USD as base currency to enable PayPal but I have kept default display currency as INR. Now conversion rate of 45rs per USD give me nasty decimal INR prices, I wana get rid of that, Magento must be using some function to convert price from base currency to INR while showing up INR prices everywhere, What is that function and How can I modify it to always give round off values??
I found :
$price = Mage::helper('directory')->currencyConvert($tax->getPrice($product, $product->getFinalPrice(), false), $fromCur, $toCur);
Is this the function Magento itself uses to convert prices in different currencies, If it is where it is defined?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
货币转换由
Mage_Directory_Model_Currency
通过以下方法执行。您可以创建此文件的
app/code/local
版本,或者编写自己的模块并重写核心。请确保在您的开发服务器和 Paypal 沙箱中非常仔细测试此内容,因为 Paypal 将拒绝任何有错误的交易!
The currency conversion is performed by
Mage_Directory_Model_Currency
in the following method.You could create an
app/code/local
version of this file, or write your own module and rewrite the core.Make sure you test this very carefully in your dev server and Paypal sandbox, since Paypal will reject any transactions that have errors!