【问题标题】:Want to show allowed payment methods on checkout page of OpenCart想要在 OpenCart 的结帐页面上显示允许的付款方式
【发布时间】:2014-06-10 07:13:55
【问题描述】:

嘿 StackOverflow 专家!

我想根据访问者选择的货币在结帐页面 (OpenCart) 上显示允许的付款方式。

例子:

如果所选货币为 INR,则显示 Ccavenue 付款方式。就像 PayPal 支付模块一样 - 显示所选货币是否为美元。与我在 Ccavenue 模块中想要的完全一样。

那我该怎么做呢?

任何建议或解决方案将不胜感激。

【问题讨论】:

  • 40 分钟前提问 得到 0 条回复。失望的 !! :(

标签: paypal module opencart


【解决方案1】:

catalog\model\payment\ 中创建文件和类,例如 ccavenue.php 或您的要求 然后创建如下所示的函数希望它有帮助

public function your_function() {

     $currencies = array(
            'INR'

        );

        if (!in_array(strtoupper($this->currency->getCode()), $currencies)) {
            $status = false;
        }

           $method_data = array();

    if ($status) {  
        $method_data = array(
            'code'       => 'your_pg',
            'title'      => $this->language->get('text_title'),
            'sort_order' => $this->config->get('your_pg_sort_order')
        );
    }

    return $method_data;
}

您可以将不同的货币放入数组中,例如澳元等

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-01-27
    • 2017-09-14
    • 2017-06-27
    • 2015-04-22
    • 1970-01-01
    • 2013-07-11
    • 2017-08-13
    相关资源
    最近更新 更多