【问题标题】:Opencart currency for 2checkout2checkout 的 Opencart 货币
【发布时间】:2012-10-24 08:29:36
【问题描述】:

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

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

【问题讨论】:

    标签: payment-gateway currency opencart 2checkout


    【解决方案1】:

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

    1. 我在 opencart 的管理面板中创建了美元货币并将其作为子货币。 (它会自动更新转化率)
    2. 在 opencart 支付控制器 (catalog\controller\payment\twocheckout.php) 中,我做了以下更改

    $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 货币有问题的人有用。

    【讨论】:

    • 请注意,Open cart 货币兑换适用于 Open Carts 内部货币兑换率,并且 2checkout 有自己的兑换率,这比通常的汇率要高得多。我认为他们也会增加汇率费用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-23
    • 1970-01-01
    • 2015-08-29
    相关资源
    最近更新 更多