2checkout的Opencart货币

时间:2012-10-24 08:29:36

标签: payment-gateway currency opencart 2checkout

该网站是在opencart中开发的,该网站包含2checkout支付网关不支持的本地货币(LKR)产品。我想将支付网关和产品的价格转换为美元。我想以当地货币(LKR)维持网站上显示的价格

是否可以将不同的货币用于显示目的和支付网关?请建议我解决此问题的扩展/方法。

1 个答案:

答案 0 :(得分:0)

最后,我想出了一种使用开放购物车货币类进行转换的方法。我在下面提到了我为解决这个问题所做的工作。

  1. 我在opencart&的管理面板中创建了美元货币。将其作为子货币。 (它会自动更新转换率)
  2. 在opencart支付控制器(catalog \ controller \ payment \ twocheckout.php)中,我做了以下更改
  3. $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);
    

    更改这两行后,它完美运作,货币值更改为美元,转换价值也正确。

    我希望这对任何遇到opencart货币问题的人都有用。