Magento – Remove shipping costs in cart

cartmagento-2.1magento2shipping-methodstotals

In default our Magento2 installation shows the shipping costs (screenshot) in the cart (even for unkown/not logged in users). We would like to not show the shipping costs in the calculation in the cart, but I can't find any configuration for it.

So the problem is not the "Estimate Shipping Costs" box, but the fact that the shipping costs need not be added until the checkout.

If I look in the source I do see this comment <!-- ko if: isExcludingDisplayed() --> around the <tr> for said shipping costs, which leads me to believe there is a setting to turn it off at this point.

But where? How? I could hide it with CSS/rip it out of the HTML, but that doesn't affect the calculation.

FYI: We have set up a single Shipping Method with Tablerates

Best Answer

In your theme add the following xml into Magento_Checkout -> layout -> checkout_cart_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <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>
</body>

I tried with Magento CE 2.1.1

Related Topic