Skip to content

Remove Type and Arguments from di.xml

How do you remove a Type and the associated arguments from a di.xml file?

Specifically, I would like to remove the “Apple Pay” button from the Shopping cart.

I have found the below code, within vendor/paypal/module-braintree-core/etc/di.xml but am unsure how to remove this section without a direct modification to the core file.

<type name="PayPalBraintreeBlockApplePayShortcutButton">
     <arguments>
         <argument name="data" xsi:type="array">
             <item name="template" xsi:type="string">PayPal_Braintree::applepay/shortcut.phtml</item>
             <item name="alias" xsi:type="string">braintree.applepay.mini-cart</item>
             <item name="button_id" xsi:type="string">braintree-applepay-mini-cart</item>
         </argument>
         <argument name="payment" xsi:type="object">BraintreeApplePay</argument>
     </arguments>
 </type>