该网站是在opencart中开发的,网站包含本地货币(LKR)的产品,这是2checkout支付网关不支持的。我想将产品的价格转换为美元用于支付网关&我想保持在网站上显示的价格在当地货币(LKR)
是否可以使用不同的货币进行显示和支付网关?请给我推荐解决这个问题的扩展/方法。
发布于 2012-10-25 18:24:32
最后,我想出了一种使用开放购物车货币类进行转换的方法。我已经在下面提到了我为解决这个问题所做的工作。
在$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);之后
行添加以下代码
$order_info['currency_code'] = 'USD';还更改了以下行
$this->data['total'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);至
$this->data['total'] = $this->currency->format($order_info['total'], $order_info['currency_code'],'', false);,并且还更改了以下行
'price' => $this->currency->format($product['price'], $order_info['currency_code'], $order_info['currency_value'], false);至
'price' => $this->currency->format($product['price'], $order_info['currency_code'], '', false);更改这两行之后,它工作得很好,货币值被更改为USD,转换值也是正确的。
我希望这将对任何对opencart货币有困难的人有用。
https://stackoverflow.com/questions/13045460
复制相似问题