I can’t pay for commercial support, specially I’m starting my project I tried this code as most of them are in shop_manager, so I’ll prevent all role from receiving cashback, BUT it’s not working with the latest WordPress and WooCommerce,
add_filter('woo_wallet_form_cart_cashback_amount', 'woo_wallet_form_cart_cashback_amount_callback');
if (!function_exists('woo_wallet_form_cart_cashback_amount_callback')) {
function woo_wallet_form_cart_cashback_amount_callback($cashback_amount) {
$user = wp_get_current_user();
if (in_array('shop_manager', (array) $user->roles)) {
$cashback_amount = 0;
}
return $cashback_amount;
}
}
Could you fix this code?