Page 1 of 1

Disable Cash on Delivery for Vouchers

Posted: Tue Nov 18, 2014 6:23 pm
by daynight
In catalog/model/payment/cod

I used the code

$method_data = array();

if (isset($this->session->data['vouchers']) && $this->session->data['payment_method'] == 'cod.cod') {
$status = false;
}

But its not working. Could anyone help me ?

Re: Disable cod for vouchers at checkout

Posted: Wed Nov 19, 2014 1:42 pm
by daynight
In Catalog/Model/Payment/Cod.php

Find
$method_data = array();

After add

if ((float)$this->cart->getTotal() == 0) {
$status = false;
}

If the product is zero, that means voucher exits in the cart, cod would be disabled. But this code doesn't works if there are products and voucher both exist in the cart.

Re:Disable Cash on Delivery for Vouchers (SOLVED)

Posted: Wed Dec 10, 2014 7:45 pm
by daynight
This vqmod disables cash on delivery if cart has vouchers or both products and vouchers in the cart.

Re: Disable Cash on Delivery for Vouchers

Posted: Wed Feb 14, 2024 2:15 am
by Ankit11188
Is this works on opencart 3.0.3.8 with journal 3. Anyone tried?