Howdy Magento 2 warriors,
In the last post, we have already discussed about How to engable/disable Wish List feature in Magento 2. All of us know how Magento 2 is powerful with so many features. But likes Wish List, Compare Products functionality is irrelevant for many store owner. Compare Products generates a detailed, side-by-side comparison of two or more products. You can customize the report to include additional attributes or remove ones that you don’t want to include. Depending on the theme, the Add to Compare link might be represented by an icon or text.
Magento 2 Compare Products Page
In Mageno 1.x, for some cases, your have to set up extension for disable Compare Products, but It will be easier in Magento 2. Now, I will show you some easy steps to disable Magento 2 Compare Products.
Not like Wish List, to disable Compare functionality, there’s no option in the administration. You need to override the
To do so, you need to copy the content of the file we named above in a new file inside your theme located under
<theme_dir>/Magento_Catalog/templates/product/list.phtml. Next, you remove the concerned lines :
$compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
data-post='<?php /* @escapeNotVerified */ echo $compareHelper->getPostDataParams($_product); ?>'
<span><?php /* @escapeNotVerified */ echo __('Add to Compare') ?></span>
Very simple, right?
But If you change your decision and want to try compare products, you don’t have to research again, because now we will show you how to configure this functionality in eyes-blink:
Recently Viewed/Compared Products section
- On the Admin sidebar, you tap Stores. Then under Settings, choose Configuration.
- In the panel on the left under Catalog, choose Catalog.
- Expand the Recently Viewed/Compared Products section. Then, do the following:
- Set Show for Current to the website, store, or store view where the configuration applies.
- In the Default Recently Viewed Products Count field, enter the number of recently viewedproducts to appear on the list.In the Default Recently Compared Products Count, enter the number of recently
compared products to appear in the list.
- When complete, tap Save Config.
Notice: The number of products listed in each block can be configured for each website, store, or store view.
Above is the How to disable Magento 2 Compare Products which gives you the basic information. If you don’t understand anything or want to ask about specific problems related to Magento 2 Compare Products, you can feel free to comment here, I will reply soon!
Check our Magento 2 POS now
Your Magento website needs a powerful Magento ERP for stock control.
DON'T MISS THE CHANCE!