Disable shipping block on the cart

To disable the shipping block on the cart summary.

Override the checkout_cart_index.xml file to theme or extension.

After body add these lines

<referenceBlock name="checkout.cart.shipping">
            <arguments>
            <argument name="jsLayout" xsi:type="array">
            <item name="components" xsi:type="array">
            <item name="block-summary" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </item>
            </item>
            </argument>
            </arguments>
        </referenceBlock>

Using the componentDisabled attribute we can pass true or false to enable and disable the shipping method block from the cart summary.

Thank you.

Leave a comment

Your email address will not be published. Required fields are marked *