• USD
  • Portuguese

How to Disable the Add to Compare Button in Magento 2?

How to Disable the Add to Compare Button in Magento 2?

The ‘Add to Compare’ button allows customers to compare products with respect to their properties, characteristics, and prices. This helps them make an informed purchase decision.

add-to-compare-button

After clicking the ‘Add to Compare’ button for multiple products, the comparison table/page allows them to analyse all the features of every product on a single page. This is shown below.

add-to-compare-for-multiple-products

As you can see from the above image, it makes it easier to select the product that matches their requirements. Let’s discuss the benefits of this comparison feature in a bit more detail.

Advantages of Magento's Compare Products Feature

Easier Decision-Making

It allows the user to make a decision without any hassle. The easier the decision-making, the better the conversion rate.

Improves User Experience

Without the comparison feature, users will need to compare each product manually by opening each link separately. This is not ideal from the user experience perspective.

Attribute Comparison

By making it easier to compare attributes, you can convince customers why a specific product is priced higher even if it appears similar to the less expensive one.

However, in certain cases, hiding the comparison button is a better option.

Other Articles:

Why Would You Want to Disable The ‘Add To Compare’ Button?

While the add to compare feature is great for technical products, you may want to disable it for items for several reasons. Let’s go through them.

Limited Product Range

If you offer limited, unique products on your store, there’s no point in offering the comparison button. Since the focus is on the uniqueness, adding the comparison button may have customers thinking that the products are similar. So, to avoid the confusion, it is better to disable this button altogether.

Focus on Specific Products

If a store is offering 100 products, about 10 will be considered top value. They may have the most sales or the highest profit margin. Thus, rather than allow users to browse through the other products, the emphasis should be on those 10 products alone. Therefore, offering the comparison button would be counterproductive.

Mobile Optimisation

The majority of the internet traffic comes from mobile devices as shown below.

internet-traffic

Source: Statista

Unfortunately, the add to comparison function does not work as well on mobile devices compared to desktops or laptops. If the majority of the traffic for your store comes from mobile devices, opting to disable the comparison button can enhance shopping experience and improve usability.

Reduced Decision Fatigue

Another reason to look into Magento 2 disable compare products functionality is to avoid overwhelming the individual. Too much choice can make them indecisive. Therefore, by removing this button, you can compel users to make a quicker decision.

Encouraging Impulse Buys

Impulse buying is a great way to boost your sales. If you display the comparison button, you are providing them time to browse through different products. This can prevent them from going through with a purchase. The better option is to offer limited time discounts to encourage an impulse buy.

Product Type

In some cases, the product type does not warrant a comparison at all. For example, for apparel products or shoes, this feature may seem irrelevant as the purchase decision does not depend on features comparison but on customer’s colour, size, and design choices.

How To Disable The ‘Add To Compare’ Button In Magento 2?

The easiest way to hide the button is using our Magento 2 Hide Price Extension.

magento-2-hide-price-extension-by-fme

With this extension, you can hide the button for a specific product or category. You can replace it with any custom text or image. With this extension, you can even apply the rules for a specific time period. Why this extension? The reason is that there is no option to hide the add to compare button in Magento 2 backend.

However, you can do it programmatically. The following code will remove the compare button from header, product, category pages and layer navigation.

Create default.xml file in app/design/frontend/Theme_Vendor/Theme_Name/Magento_Catalog/layout and copy the following code.
<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="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" />
 </body>
</page>
  

Now, Set $showCompare variable 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

Final Thoughts on Magento 2 Compare Products Disable

That’s about it on how to disable the add to compare button in Magento 2. If you've any issue, feel free to contact our support team for an instant solution.

This blog was created with FME's SEO-friendly blog