• Jesse Jarvis

    (@jessejjarvis)


    Right now GPay (which I believe is using Stripe right now) and whatever else is hidden until the user is logged in. That’s why I unchecked guest checkout, however PayPal still displays the button while logged out. Ideally I want the users to be forced to register/login as the website will have digital downloads and I believe it’s a good thing to have them register an account so they always have access to the digital designs. Below is my Divi Builder and it’s showing outside of I image where Stripe and the other Woocommerce supported payments are.

    I am using Woocommerce with “WooCommerce PayPal Payments” plugin.

    TL;DR: Woocommerce > Accounts & Privacy >  Allow customers to place orders without an account is unchecked and yet PayPal still butting in with its guest order button.

    Thank you for any help I can get.

    • This topic was modified 1 year ago by Jesse Jarvis.
    • This topic was modified 1 year ago by Jesse Jarvis. Reason: added additional info

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Jesse Jarvis

    (@jessejjarvis)

    I’ve even tried this:

    add_filter( 'woocommerce_available_payment_gateways', 'conditionally_disable_paypal_payment_gateways', 10, 3 );
    function conditionally_disable_paypal_payment_gateways( $available_gateways ) {
        // if ( is_admin() ) return $available_gateways; // Only on frontend
    
        // Loop through payment gateways
        foreach( $available_gateways as $gateways_id => $gateways ){
            if ( ! is_user_logged_in() && $gateways_id === 'PayPal' ) {
                unset($available_gateways[$gateways_id]);
            }
        }
        return $available_gateways;
    }

    But it doesn’t seem to work. I found and modified code I found elsewhere that did the same thing but for users logged into a certain role and adjusted it to what I thought would work :/

    Thread Starter Jesse Jarvis

    (@jessejjarvis)

    GPay only shows when the user has it available as an option. It should while signed out on my phone, but not while signed out on Chrome or Microsoft Edge. However it shows when logged in on the website with Chrome.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only PayPal showing button while logged out’ is closed to new replies.