I'm currently having the issue, that I cannot remove the Checkout with Paypal
Button that comes from a Payment Option called Paypal Express Checkout
.
In the Magento2 Configuration settings I did set "Display on Product Details Page" to "NO", but it doesn't seem to disable it.
I did clear Cache multiple times and still does not work. I've seen multiple people having this problem.
Best Answer
Take a look:
vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html
This button shortcut shows in this part.
The
extra_actions
cart data comes from:vendor/magento/module-checkout/CustomerData/Cart.php
Navigate to
Magento\Catalog\Block\ShortcutButtons
class, we will see a Dispatch shortcuts container event:shortcut_buttons_container
.The Paypal module will catch this event to add its button:
vendor/magento/module-paypal/etc/frontend/events.xml
In this event, it will checks the Paypal Method is available or not. So, the Paypal button will not show if the payment method is disable in Admin.
Yes, it will not affect on the minicart.
In this case, I have a suggestion for you. We can disable the
paypal_shortcuts
event, create the custom one. We can add more config for Paypal in Admin (e.g: Display on Mini Cart - Yes/No) and check this config in the custom event.