Issue
I want to remove some portion from di.xml of vendor module. Below example of some portion that to be removed.
<type name="Magento\Braintree\Block\GooglePay\Shortcut\Button">
<arguments>
<argument name="data" xsi:type="array">
<item name="template" xsi:type="string">Magento_Braintree::googlepay/shortcut.phtml</item>
<item name="alias" xsi:type="string">braintree.googlepay.mini-cart</item>
<item name="button_id" xsi:type="string">braintree-googlepay-mini-cart</item>
</argument>
<argument name="payment" xsi:type="object">BraintreeGooglePay</argument>
</arguments>
</type>
How can I remove the it using override of di.xml in custom module.
Solution
Thanks for sharing the possible options.
The solution that did work for me is to make the item inside argument tag to null. In my scenario, I do not want this item in dependency injection. That works for me.
Below code added in custom module etc/frontend/di.xml
<type name="Magento\Braintree\Block\GooglePay\Shortcut\Button">
<arguments>
<argument name="data" xsi:type="array">
<item name="template" xsi:type="null" />
<item name="alias" xsi:type="null" />
<item name="button_id" xsi:type="null" />
</argument>
<argument name="payment" xsi:type="object">BraintreeGooglePay</argument>
</arguments>
</type>
Answered By - Rahul Hedaoo Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.