Last Updated: September 27, 2021
·
10.29K
· sivaschenko

Remove product compare functionality from magento 2 frontend

default.xml layout file:
<referenceBlock name="catalog.compare.sidebar" remove="true"/> <referenceBlock name="catalog.compare.link" remove="true"/>
Set $showCompare to false in the following templates:

  • Magento/Catalog/view/frontend/templates/product/list/items.phtml
  • Magento/Catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml
  • Magento/Catalog/view/frontend/templates/product/widget/new/content/new_list.phtml
  • Magento/Catalog/view/frontend/templates/product/widget/content/grid.phtml

Remove compare related staff from the following templates:

  • Magento/Catalog/view/frontend/templates/product/list.phtml
  • Magento/Catalog/view/frontend/templates/product/listing.phtml
  • Magento/Wishslist/view/frontend/templates/item/configure/addto.phtml