[ad_1]
Hi,
I am trying to prevent users from receiving cashback when they make a payment through the wallet.
I have added the following piece of code in the functions.php of my website’s active theme:
add_filter('woo_wallet_form_order_cashback_amount', 'woo_wallet_form_order_cashback_amount_callback');
if (!function_exists('woo_wallet_form_order_cashback_amount_callback')) {
function woo_wallet_form_order_cashback_amount($cashback_amount, $order_id) {
$order = wc_get_order( $order_id );
$payment_method = $order->get_payment_method();
if ($payment_method == 'wallet') {
$cashback_amount = 0;
}
return $cashback_amount;
}
}However, this does not enforce the mentioned action. Would it be possible for you to suggest a solution to this problem?
Regards,
Rajat
- This topic was modified 3 hours, 4 minutes ago by .
