How to Disable Compare Products in Magento 2

How to Disable Compare Products in Magento 2

Magento 2 offers a vast range of functionalities to make the most out of the platform. However, you may not need them all! It depends on the type of business and its requirements that you chose the features to include or not.

For example, there is a built-in feature to allow customers to compare the products. It is a very useful functionality if you are selling items like appliances, machines, software, etc for which the purchase decision depends on the features and price balance. In such cases, the customers need the “compare products” feature to check the feasibility.

However, if you are selling apparel, the purchase decision depends on the choice, liking, size availability, etc. and the customers do not need to compare two dress’ features, isn’t it!

Unfortunately, the default functionality does not allow to simply disable compare products in Magento 2. So, I’ve come up with a programmatic solution that allows to remove compare product functionality.

Method to Disable Compare Products in Magento 2:

Create default.xml file in Vendor/Extension/view/frontend/layout  and copy the below code:

That’s it.

Any doubts?

Feel free to mention them in the Comments section below. I’d be happy to help.

Please share the above solution with the fellow developers via social media.

Thank you.
Meetanshi Contacts

5
(based on 4 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply