@hassanyousufx Please use the attached updated code.
add_filter('process_woo_wallet_general_cashback', 'process_woo_wallet_general_cashback_callback', 10, 2);
if (!function_exists('process_woo_wallet_general_cashback_callback')) {
/**
*
* @param type $process
* @param WC_Order $order
*/
function process_woo_wallet_general_cashback_callback($process, $order) {
if ($order->get_coupons()) {
$process = false;
}
return $process;
}
}
add_filter('woo_wallet_product_wise_cashback_amount', 'exclude_on_sales_products', 10, 2);
add_filter('woo_wallet_product_category_wise_cashback_amount', 'exclude_on_sales_products', 10, 2);
if(!function_exists('exclude_on_sales_products')){
function exclude_on_sales_products($cashback_amount, $product){
if($product->is_on_sale()){
$cashback_amount = 0;
}
return $cashback_amount;
}
}