Disable cashback for subscriber user role.
-
Hi, I am using this code in theme fucntion.php file to disable cashback for subscriber user role, but it is not working, is there anything wrong in this code? Please help.
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(‘subscriber’, (array) $user->roles)) {
//disable cashback for “subscriber” role
$cashback_amount = 0;
}
return $cashback_amount;
}}
The page I need help with: [log in to see the link]
- The topic ‘Disable cashback for subscriber user role.’ is closed to new replies.