Removing Product Comparison in Magento

12 Comments 29th MAY 2009 | Posted by Željko Prša in Magento

Removing Product Comparison in Magento

As many things in Magento, removing product comparison is not available thru the admin interface. Thus, leaving us with the only option of getting down and dirty with theme files editing.

This guide is pretty straightforward and is based on the Magento ver. 1.3.1.1

Before beginning of this procedure please Go to: System-> Cache Management and disable cache. You can turn it on after you’re done.

Step 1 – reports.xml

Open: app/design/frontend/deafult/Your Theme name/layout/reports.xml and delete the following lines:

<block type="reports/product_compared" before="right.permanent.callout" name="right.reports.product.compared" template="reports/product_compared.phtml" />
<block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />

Step 2 – catalog.xml

Open app/design/frontend/deafult/Your Theme name/layout/catalog.xml and delete the following line:

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

Save the files and refresh the page you we’re checking. Product comparison should not be there but if you click on any of the products you ‘ll see that the “Add to compare” text link is still there.

The way to remove it:
Step 3 – addto.phtml

Open up app/design/frontend/default/Your Theme name/template/catalog/product/view/addto.phtml and delete the following line:

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

Oh, of course theif you don’t want to actually delete the code can always use the following:

 <remove name="name_of_the_ol_block"/>

That’s it. You should now be free of product comparison for ever and ever :)

If you like what you read, please share it.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Yahoo! Bookmarks
  • Reddit
  • Technorati
  • Twitter
  • StumbleUpon
  • LinkedIn
  • Netvibes
  • NewsVine
  • Sphinn
  • Tumblr
  • Posterous

To post code in comments, place your code inside [code] and [/code] tags.

There are 12 comments (Add Yours +)

  • @Zeljko I like the last one :)

  • Thank you very much!

    “add to compare” doesn’t remove in the product list or grid with this changes. You need to change a little bit more:

    app/design/frontend/default/Your Theme name/template\catalog\product\list.phtml

    76 |
    77 <a href=”">__(‘Add to Compare’) ?>
    78

    116 getAddToCompareUrl($_product)): ?>
    117 <a href=”">__(‘Add to Compare’) ?>
    118

  • I see you can’t post the code I did in the previous post. And you need to change another file for the “My Account” pages.

    app/design/frontend/default/Your Theme name/layout/customer.xml
    delete line 191

    app/design/frontend/default/Your Theme name/catalog/product/list.phtml
    delete line 76, 77, 78, 79, 116, 117, 118

    app/design/frontend/default/Your Theme name/

  • Sheetal Tomer Says

    Thanks for your help…
    its working….

  • just a note to anyone looking to fully remove the add to compare functionality…

    you will need to edit crosssell.phtml to remove the add to compare link as well

    app\design\frontend\default\default\template\checkout\cart

  • Thanks for the tutorial and additional comments guys – saved me a bunch of time compared to the last time I tried to do the same.

  • Thanks!!!
    It worked! =)

  • Why you want disable product comparision?

  • Really nice – thanks for all your support and you taking the time to find all these files to edit. Great forum.

  • Stephanie Says

    It works! I am using 1.3.2.4. Looks complicated at first but its easier then the rest.

  • Thanks! works very well.

    I hope there will be future updates to magento to have this added to the admin backend as an option.

  • I spent hours finding and deleting code trying to get “add to compare” off my website. Then I found this info:

    http://www.aschroder.com/2009/07/removing-the-compare-function-in-magento-the-easy-way/

    It was really easy. Just follow the directions and your “add to compare” should not be visible on the website.

Leave a Comment

Please wrap all source codes with [code][/code] tags.
Magento Design and Development | Magento SEO | iPhone Application Development Web Application Development with ZEND | WordPress Ecommerce | WordPress development
Sitemap

Inchoo - webappsolutions | 2009