Magento 1.x. How to Disable Compare Products Feature

Here you can find the instructions on how to disable “Add To Compare” option.

compare-products-zemez-magento

zemez wordpress themes

Open list.phtml file

  • Firstly, open list.phtml file under the app/design/frontend/default/themeXXX/template/catalog/product folder. In order to do this, you can use your FTP client or FileManager in your Hosting Control panel.

compare-products-zemez-magento

Remove “add to compare” option

  • The next step is to disable “Add to compare” option for the product list view and/or product grid view.
  • Then you need to delete the following 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; ?>
view raw .phtml hosted with ❤ by GitHub
You can use CTRL+F to simplify the search process.
  • In order to disable the “Add To Compare” option for the product page, you should copy addto.phtml file from the app/design/frontend/base/default/template/catalog/product/view folder to the app/design/frontend/default/themeXXX/template/catalog/product/view folder and delete the next code:
<?php
$_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>-->
view raw .phtml hosted with ❤ by GitHub
  • Then, if you want to disable “Add To Compare” for the sidebar, you need to edit catalog.xml file stored in the app/design/frontend/default/themeXXX/layout folder and delete the following code:
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
view raw .xml hosted with ❤ by GitHub

Upload the files to the server

  • Save your changes and upload the files to your server.
  • Note, you may need to clean Magento cache.
  • Finally, open your website and refresh the page by pressing the CTRL+F5 key combination.
monster one