12/18/2015 - 10:53 PM

How to disable compare products feature

How to disable compare products feature


1) Open list.phtml file located in app/design/frontend/default/themeXXX/template/catalog/product 

2) You will need to remove “add to compare” option from product list view and/or product grid view.

3) Find this Code:
<?php if($_compareUrl=$this-getAddToCompareUrl($_product)): ?>
  <li><span class="separator">|</span> 
  <a  title="<?php echo $this->__('Add to Compare') ?> " href="<?php echo $_compareUrl ?>" rel="tooltip" class="link-compare "><?php echo $this->__('Add toCompare') ?></a></li>
<?php endif; ?>

4) Comment those lines above

5) Do the same to alter items in a grid view.

6) In order to remove the Add To Compare option from the product page, you should 
copy addto.phtml file from app/design/frontend/base/default/template/catalog/product/view directory 
into app/design/frontend/default/themeXXX/template/catalog/product/view directory 
and remove or comment out the following code:

$_compareUrl = $this->helper('catalog/product_compare')->getAddUrl($_product);
<?php if($_compareUrl) : ?>
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>-->
<?php endif; ?>

8) Lastly, if you want to remove the Add To Compare option from the sidebar, 
you need to edit catalog.xml file located in app/design/frontend/default/themeXXX/layout directory 
and remove the following code:

<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>

10) Clear Magento Cache