Development Notes: Remove Paypal version of 'Pay By Debit of Credit Card' button on the Woocommerce checkout
Environment:
WordPress / Woocommerce / WooCommerce PayPal Payments
Problem:
The PayPal Woocommerce plugin is adding an unwanted generic debit and credit card payment alongside its standard 'Pay By PayPal' button.
Consequential Problems:
- Checkout attempts with an untested method.
- Continuous loading of the PayPal payment page. Users may see a continuous blue spinning loading icon when click Complete Checkout.
- Reload of the checkout page when completing with PayPal 'Debit of Credit Card' option.
What we tried:
- Employing alternative PayPal plugins.
- Manually hiding the code via CSS as a temporary workaround.
Solution for this case:
At the time of writing, there does not appear to be a way to disable the button in the plugin settings. We employed the following workaround:
1. In the PayPal plugin settings click the 'Standard Card Button'
(.../wp-admin/admin.php?page=wc-settings&tab=checkout§ion=ppcp-card-button-gateway)
2. Check the option 'Enable Standard Card Button gateway' which separates the button into a new payment method you'll now see in the payment method list. It's important not to disable this method as it will just recur within the PayPal method by default.
3. This applies some style attributes to the front-end which allow us to control the option with CSS. We added the following style attribute in a style sheet to remove the option from view:
.payment_method_ppcp-card-button-gateway{display:none!Important;}
Conclusion
The solution is less than ideal but a quick way to remove the unwanted PayPal debit button. Clearly, PayPal is looking to funnel standard debit and credit card payments away from their competitors. However, PayPal is commonly used alongside other favourable credit card processors and the button is too intrusive.