DEV Community

Paboda Hettiarachchi
Paboda Hettiarachchi

Posted on

Remove product compare - Magento 2

There is no configuration setting to remove Product "Compare" feature in Magento2. This can be done via layout file. (for
example: in app/design/frontend/vendor/theme/Magento_Theme/layout/default.xml

<referenceBlock name="catalog.compare.link" remove="true"/>
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="view.addto.compare" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="upsell.product.addto.compare" remove="true" />
<referenceBlock name="crosssell.product.addto.compare" remove="true" />
<referenceBlock name="catalogsearch.product.addto.compare" remove="true"/>

tested in Magento 2.4.0

Top comments (0)