Tax block in cart page of Magento 2

I am explaining here a way to remove the estimated tax block seen in the summary section of cart page

Create a file checkout_cart_index.xml at the location app/design/frontend/Dw/green/Magento_Checkout/layout/ (Dw/green is a custom theme)

Copy the content as seen below in the layout file

<?xml version="1.0"?>
<page xmlns:xsi="" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
	<referenceBlock name="checkout.cart.shipping">
	        <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>

Also in case you want to remove the heading as well than copy vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml file to app/design/frontend/Dw/green/Magento_Checkout/templates/cart and comment/remove the below mentioned part

<div class="title" data-role="title">
        <strong id="block-shipping-heading" role="heading" aria-level="2">
            <?= /* @escapeNotVerified */ $block->getQuote()->isVirtual() ? __('Estimate Tax') : __('Estimate Shipping and Tax') ?>

Hope this is helpful

Leave a Reply

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

Scroll to top