Subheader

Lazy Programmer's Blog

Pages

Thursday, May 30, 2024

How to disable Compare Products module in Magento 2

Tested & worked for Magento 2.4.*
Algorythm for Ubuntu
1) cd [MAGENTO_ROOT]/vendor/magento/theme-frontend-luma/Magento_Catalog/layout
2) nano default.xml
3) Add the following code at the end of xml doc before tag:
<referenceBlock name="catalog.compare.link" remove="true" />
<referenceBlock name="catalog.compare.sidebar" remove="true" />
<referenceBlock name="catalogsearch.product.addto.compare" remove="true" />
<referenceBlock name="category.product.addto.compare" remove="true" />
<referenceBlock name="crosssell.product.addto.compare" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="upsell.product.addto.compare" remove="true" />
<referenceBlock name="view.addto.compare" remove="true" />
4)launch bin/magento c:c & bin/magento c:f

No comments:

Post a Comment