Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author pimwick

    (@pimwick)

    You can prevent a gift card from working programmatically with the pwgc_gift_card_can_be_redeemed hook.

    Here is template code you can use, however you will need to add the logic to determine the role for the current user.

    function custom_pwgc_git_card_can_be_redeemed( $message, $gift_card ) {
        $gift_card_allowed = true;
    
        //
        // Here is where you need to write code to determine
        // if the cart will allow a gift card to be redeemed.
        //
    
        if ( ! $gift_card_allowed ) {
            $message = 'Gift cards cannot be used for this order.';
        }
    
        return $message;
    }
    add_filter( 'pwgc_gift_card_can_be_redeemed', 'custom_pwgc_git_card_can_be_redeemed', 10, 2 );
    Plugin Author pimwick

    (@pimwick)

    I’m closing this thread but let us know if you have any additional questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove gift cards for specific roles’ is closed to new replies.