• Resolved albarosa

    (@albarosa)


    Hello @mrclayton,

    It’s about the following: I am combining the PayPal Payment Plugin with the Stripe Payment Plugin for various reasons. One of the reasons is that PayPal is not compatible with the block-based checkout, which is why I would like to remove the PayPal payment section from the checkout page. However, unfortunately, this “checkbox” seems to recognize the two payment providers (PayPal and Stripe for credit cards) as a single object, at least I cannot hide the PayPal payment option with CSS. For example, if I apply “display: none;” to the class “.wc-block-components-radio-control-accordion-option”, the payment option from Stripe also disappears. I have not found any other classes with which PayPal could be cleanly removed (button + logo + text + checkbox) from the checkout so that the credit card payment from Stripe is displayed correctly (without a checkbox).

    I do not want to completely deactivate the PayPal plugin, as I want to offer PayPal on the shopping cart page, where it also makes sense, as under the PayPal button on the shopping cart page there is still the option “Or Proceed to payment” (in German languange “Weiter zum Bezahlen”), which then leads to the checkout page where I really only want to offer the credit card option from Stripe.

    Is there a possibility to remove the PayPal payment option with PHP or other code? I couldn’t find anything.

    Thank you for a response,
    Albarosa

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    Hi @albarosa

    One of the reasons is that PayPal is not compatible with the block-based checkout

    That is not correct. This PayPal plugin works with and was coded specifically to support the cart and checkout blocks. There are many merchants using the blocks with this plugin.

    if I apply “display: none;” to the class “.wc-block-components-radio-control-accordion-option”, the payment option from Stripe also disappears.?

    That’s because CSS written that way will target all selectors that match that query. If you know the ordering of the payment methods you can do something like the following:

    .wc-block-components-radio-control-accordion-option:nth-of-type(1){
        display: none;
    }

    Where (1) would be the index of PayPal.

    Kind Regards

    Thread Starter albarosa

    (@albarosa)

    Hello @mrclayton,
    
    ---> That’s because CSS written that way will target all selectors that match that 
    query. If you know the ordering of the payment methods you can do something like the following:
    
    .wc-block-components-radio-control-accordion-option:nth-of-type(1){
        display: none;
    }
    
    Where (1) would be the index of PayPal.
    
    1.) Yes, that works. Thank you so much! Is there another way to hide the checkbox or to make the remaining credit card payment method with Stripe appear as if the PayPal plugin were deactivated, without the checkbox? So that customers don't have to click on it again.
    
    2.) How i can find the ordering of the payment methods? In the Inspector? In a file?
    
    ---> That is not correct. This PayPal plugin works with and was coded specifically to support the cart and checkout blocks. There are many merchants using the blocks with this plugin.
    
    No, I didn't mean your plugin, because it is fantastic, works perfectly, is by far the best for me, and integrates seamlessly. I meant PayPal itself, because the PayPal button in the checkout makes the entire checkout page and payment button redundant. I mean, if you pay with PayPal, you can just as easily do it in the shopping cart and skip the checkout page altogether, right? Or did I not understand that correctly? I'm new to here/WooCommerce.
    
    On my checkout page (WordPress page), I receive a notification on the right side that PayPal Gateway By Payment Plugins is incompatible with block-based checkout:
    https://snipboard.io/b16vlC.jpg
    I don't know why this appears, because as I said, your plugin works perfectly and has nothing to do with not wanting PayPal on my checkout page. Clicking on the "Learn more" link leads to the following page: https://woocommerce.com/document/cart-checkout-blocks-status/.
    
    By clicking on "Use a supported payment gateway," you are taken to this page: https://woocommerce.com/document/cart-checkout-blocks-status/#compatible-extensions.
    
    And if you click on "If you use an incompatible extension which has declared its incompatibility," you ultimately arrive at this page: https://developer.woocommerce.com/2023/11/06/faq-extending-cart-and-checkout-blocks/.
    
    It states that "If an extension is a payment gateway, you must follow the payment method integration steps and declare its compatibility."
    
    And now, my question: Do I need to declare compatibility by adding the suggested code to the main plugin file? Or am I completely on the wrong path?
    
    Best regards
    • This reply was modified 6 months, 3 weeks ago by albarosa.
    • This reply was modified 6 months, 3 weeks ago by albarosa.
    • This reply was modified 6 months, 3 weeks ago by albarosa.
    • This reply was modified 6 months, 3 weeks ago by albarosa.
    Plugin Author Payment Plugins

    (@mrclayton)

    Hi @albarosa

    1. Not that I am aware of. The checkout block from WooCommerce is much more restrictive than the checkout shortcode and limits that amount of customization that can be done.
    2. Ordering of payment methods is controlled by WooCommerce and is based on the WooCommerce > Settings > Payments page.

    Or did I not understand that correctly?

    My recommendation would be to offer PayPal on your checkout page as well. If any required fields are missing and the customer needs to finalize payment on the checkout page, you want the payment method to be available there to.

    I don’t know why this appears, because as I said, your plugin works perfectly and has nothing to do with not wanting PayPal on my checkout page.

    This is caused by a limitation with the WooCommerce block code and how they determing compatibility.

    Do I need to declare compatibility by adding the suggested code to the main plugin file? Or am I completely on the wrong path?

    You don’t need to do anything except connect the plugin to your PayPal business account. There is no coding required to use this plugin. You can ignore the compatibility message as it’s not relevant or accurate.

    Kind Regards

    Thread Starter albarosa

    (@albarosa)

    Hello @mrclayton,

    1.) Ah, okay. Now things are starting to make sense to me. I have been trying for hours to achieve something with JS and CSS; without success. Thank you for the information, now I know and can save myself the trouble in the future.

    2.) Perfect! Your answers are truly invaluable. I simply placed the credit cards above PayPal and the problem has now resolved itself, as the credit cards are automatically selected, thus opening the gateway and customers do not need to click separately. And for the CSS code, I simply replaced the (1) with a (2). Thank you!!!

    —> My recommendation would be to offer PayPal on your checkout page as well. If any required fields are missing and the customer needs to finalize payment on the checkout page, you want the payment method to be available there to.

    Ah, I didn’t know that. Unfortunately, the problem is that it will not be possible for me to display PayPal in the checkout in any case (at least until I find a solution), because I also want to sell to Germany and there are additional rules that apply in Germany. The “Pay Now” button MUST be located directly below the total amount. This is not the default setting in Woocommerce, which is why I installed the “Germanized” plugin. Now the button is correctly placed according to German law, but not the PayPal button, as it is treated separately from the “Pay Now” button. I have tried moving the PayPal button with CSS, PHP, and JS, but to no avail. Therefore, ultimately I have no choice but to hide the PayPal button on the checkout page. However, I can display it on the cart page (if I am correctly informed), as it happens to be located directly below the “Total Order Value,” as German law requires.

    Thank you very much for your helpful answers. They have helped me find an acceptable solution to my problem.

    Best regards

    Plugin Author Payment Plugins

    (@mrclayton)

    I have tried moving the PayPal button with CSS, PHP, and JS, but to no avail. Therefore, ultimately I have no choice but to hide the PayPal button on the checkout page.?

    Have you considered using the Use Place Order Button option located on the PayPal Settings page? That option uses the WooCommerce place order button to process the PayPal payment, rather than rendering the separate PayPal button. The German market is who we had in mind with that option.

    Kind Regards

    Thread Starter albarosa

    (@albarosa)

    —> Have you considered using the Use Place Order Button option located on the PayPal Settings page? That option uses the WooCommerce place order button to process the PayPal payment, rather than rendering the separate PayPal button. The German market is who we had in mind with that option.

    Yes, I had this option activated, but with the activated Germanized plugin it doesn’t work, because when I choose PayPal and then click on the “Buy Now” button, nothing happens. Only the “Buy Now” button (not the PayPal Gateway) loads for a moment and then everything is back to how it was before. I couldn’t find any error messages either. Here is a screenshot of how it looks with Germanized activated and deactivated:
    https://snipboard.io/Wnmq4i.jpg

    (input fields are all checked/filled correctly)

    Plugin Author Payment Plugins

    (@mrclayton)

    Yes, I had this option activated, but with the activated Germanized plugin it doesn’t work, because when I choose PayPal and then click on the “Buy Now” button, nothing happens.

    That sounds like a potential issue with Germanized integration with the block checkout. Do you have a staging site where this can be tested in Sandbox mode? If so please share a link to a product page on your staging site.

    Kind Regards

    Thread Starter albarosa

    (@albarosa)

    —> That sounds like a potential issue with Germanized integration with the block checkout. Do you have a staging site where this can be tested in Sandbox mode? If so please share a link to a product page on your staging site.

    Yes, my hosting provider offers staging service, but I haven’t really used it yet because my website is not officially accessible and I always work on the “original” version. Just now, I have created a staging copy, the link to which is as follows:
    https://prelook.1001smiles.de/produkt/1001-smiles-will-ein-buddha-werden-band-1-reise-zum-mond-zur-venus/

    I have put the PayPal plugin in sandbox mode and put my original website back into “maintenance mode”. I hope the staging site is displayed correctly on your side.

    Best Regards

    Thread Starter albarosa

    (@albarosa)

    WOW, I just noticed that the “Buy Now” button also works with PayPal… and I don’t even know what to say… I’m truly speechless. I never expected that you had implemented that as well. I mean, I have observed many checkouts in the past few months and have gained a minimal insight into the complexity of developing a truly professional checkout with payment options. And all I can say is: Hats off to such a masterpiece, or masterpieces, because combining PayPal with Stripe so seamlessly and harmoniously… well, that’s impressive.

    So happy with the best checkout page in Europe :-)))

    Can I pay for something? I would like to show my appreciation, maybe with a fixed amount.

    And I would also like to know if you generally accept paid, individual orders.

    Best Regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Remove PayPal from Checkoutpage only (in combination with Stripe)’ is closed to new replies.