• Resolved mughsein

    (@mughsein)


    Hi, how to disable cashback function for specific user role?
    If you already resolved this issue previously, please provide me the link.
    Thank you

Viewing 1 replies (of 1 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @mughsein Please use bellow code into active theme function.php file to disable cashback for the specific user role.

    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('author', (array) $user->roles)) {
                //disable cashback for "author" role
                $cashback_amount = 0;
            }
            return $cashback_amount;
        }
    
    }

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Disable cashback for specific user role.’ is closed to new replies.