How To Disable Compare Products In Magento 2
In this post, I will guide you on How To Disable Compare Products In Magento 2. Compare products is a useful feature, its help customer can compare information between products, from this they can choose the suitable product for them.
But for some stores, it will no longer be relevant. To optimize performance and reduce redundant functions for the store you can disable it.
What is compare products?
The Compare Products function allows displaying detailed information of two or more similar products in terms of categories and characteristics to users. Comparative products are placed next to each other to show the difference clearly.
Compare products function is built-in to Magento 2. It will be very suitable if you have a store that sells phones, home appliances, electronics, etc. Items that focus on hardware, features, and price.
Steps To Disable Compare Products In Magento 2
1. Go to app/design/frontend/Theme_Vendor/Theme_Name/Magento_Catalog/layout.
2. Create default.xml file and add the following code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="catalog.compare.link" remove="true"/>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="category.product.addto.compare" remove="true"/>
<referenceBlock name="catalogsearch.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"/>
</body>
</page>
3. Save the file and the Compare Products was disable.
Follow us for the more helpful posts!
We hope this is a useful post for you.
You can read more useful posts like How To Setup Email Refer A Friend In Magento 2.
Thank you for reading!