在Opencart 2.3.0.2中自动申请优惠券

时间:2017-10-20 12:03:39

标签: opencart opencart2.x

当客户退房时,尝试自动应用优惠券代码(实际上有2个),这样我可以在特定类别或购买的4件和10件商品中提供折扣,而无需客户输入代码。我尝试手动将我的优惠券名称添加到/catalog/controller/checkout/cart.php文件的“金额”凭证中,但没有成功。对此有一个简单的解决方法吗?

        // Gift Voucher
        $data['vouchers'] = array();

        if (!empty($this->session->data['vouchers'])) {
            foreach ($this->session->data['vouchers'] as $key => $voucher) {
                $data['vouchers'][] = array(
                    'key'         => $key,
                    'description' => $voucher['description'],
                    'amount'      => $this->currency->format($voucher['FOUR'], $this->session->data['currency']),    

0 个答案:

没有答案