How to remove apply discount code from cart page in magento 2

Sometimes you may want to remove the apply discount code from the cart page and it’s quite easy. Since magento itself recommends the xml way to remove an element or block, so we will follow the same.

Edit this file,

app/design/frontend/{Vendor}/{theme}/Magento_Checkout/layout/checkout_cart_index.xml

and enter below piece of code

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="cart.discount" remove="true"/>
    </body>
</page>

Refresh the cache and reload the page. You have successfully removed the discount block from the cart page.

About the Author: magechamp

Leave a Reply

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