• Resolved antonials

    (@antonials)


    Hello!
    We are using B2B Market from MarketPress and your Plugin PayPal Express Checkout Payment Gateway for our Website. We are using the Paypal Plugin to add the additional payment method in the checkout and to display the Paypal Express Button in the cart. Paypal Express is activated in the Woocommerce settings, however we need it to be disabled for B2B customers. We deactivated it for User Group B2B but the Express Button still appears in the cart. In the checkout it works fine, no Paypal checkout possible there for B2B users.
    So in short, our problem is, that the Paypal Express Button appears in the cart for B2B users, although we have it deactivated for B2B user group.
    We have already written to MarketPress and they given us this information:

    “The developers of the Paypal Plugin need to add a filter or another possibility for us to edit the execution of code in class-paypal-express-hook.php in line 10. At the moment there is this code at line 10: add_action(‘woocommerce_proceed_to_checkout’,array($this,’eh_express_checkout_hook’),20);
    We can not access it with $this, so there either needs to be a filter for the array, a filter added to the function itself, or they could add a filter in class-eh-paypal-init-handler.php in line 33 like this: $this->hook_include=new Eh_Paypal_Express_Hooks();”

    Therefore we would be grateful if you could make the mentioned changes!
    Thank you in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @antonials,

    We will look into it.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @antonials,

    We have released a new update with an additional filter that can be used to hide the button based on the user role. Here is a sample code.

    add_filter('eh_hide_paypal_express_button_in_cart','eh_hide_paypal_button_function');
    function eh_hide_paypal_button_function(){
    
    //hides express button for user roles other than administrator
    $current_user = wp_get_current_user();
    $role = $current_user->roles;
    if(in_array('administrator',$role)){
    return true;
    }else{
    return false;
    }
    }

    Please leave us a review if you like the plugin.

    Thread Starter antonials

    (@antonials)

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Paypal Express Button – remove for B2B Users in Cart’ is closed to new replies.