@imarnab123,
Thanks for reaching out to our support forum. Just go to WooWallet > Settings > General and disable Cash on delivery checkbox to disallow wallet credit for cash on delivery while placing an order.
Thanks and Regards,
Subrata Mal
Thread Starter
Arnab
(@imarnab123)
We have already done this, in settings general this option is available
“Cash on delivery -> Allow this gateway for recharge wallet”. We have unchecked this option and its removing the cash on delivery option in case of wallet recharge but I just wanted to prevent wallet credit while a customer places an order in cash of delivery mode.
I have also gone throw this topic in the support forum “Cashback for Completed Orders only”. But its not working for some reason. so as of now i have commented out the action hook “add_action(‘woocommerce_order_status_processing’, array($this->wallet, ‘wallet_cashback’), 12);” in includes/class-woo-wallet.php.
But its not a good practice so if you can show me any way around this.
Thanks and Regards
Arnab Chakraborty
@imarnab123,
Okay, you want to restrict cashback for cash on delivery payment method! Please use below code snippet to themes function.php file.
add_filter('woo_wallet_general_cashback_amount', 'woo_wallet_general_cashback_amount', 10, 2);
function woo_wallet_general_cashback_amount($amount, $order_id){
$order = wc_get_order($order_id);
if('cod' === $order->get_payment_method('edit')){
return false;
}
return $amount;
}
Thanks and Regards,
Subrata Mal
Thread Starter
Arnab
(@imarnab123)
Thanks Subrata Mal, it worked.
Regards:
Arnab Chakraborty
Hi, I’m looking for same feature.
But somehow the code did not work for me. How can I disable Cashbacks for COD orders?
Please use updated code.
add_filter('process_woo_wallet_general_cashback', 'process_woo_wallet_general_cashback_callback', 10, 2);
function process_woo_wallet_general_cashback_callback($process, $order){
if('cod' === $order->get_payment_method('edit')){
return false;
}
return $process;
}