To remove the “Estimate shipping costs and tax” block from the cart page:
#1 Add the following code to checkout_cart_index.xml
in your theme (create a new file if it doesn’t exist). The file should be in app/code/design/frontend/<Theme_Vendor>/<Theme_Name>/Magento_Checkout/layout/
.
#File: app/code/design/frontend/<Theme_Vendor>/<Theme_Name>/Magento_Checkout/layout/checkout_cart_index.xml <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>
#2 Override the template file cart/shipping.phtml
in your theme (or module) and remove the following lines
<div class="title" data-role="title"> <strong id="block-shipping-heading" role="heading" aria-level="2"> <?= $block->getQuote()->isVirtual() ? $block->escapeHtml(__('Estimate Tax')) : $block->escapeHtml(__('Estimate Shipping and Tax')) ?> </strong> </div>
Then clear your cache and you are good to go 🙂
Hi, thank you for the explanation.Can’t get the shipping.phtml in the right place. Can you point me in the right direction?
Thanks a lot!
The file should be place under your theme folder.
app/code/design/frontend/_Theme_Vendor_/_Theme_Name_/Magento_Checkout/cart/shipping.phtml
Hi there,
Do I replace the other code that is already in “checkout_cart_index.xml” with the code provided above or do I add your code to the bottom?
Thanks 🙂
No, you should add to it