How To Get Rid Of Product Comparison Feature In Magento

magento-product-comparison

Product comparison feature is loved by many customers as it gives them a precise idea about the interesting products in one place but this feature is not apt for few stores who do not wish to have product comparison feature. If you run a music store then comparing between two different music albums or songs would be of no real use.

Developer around the world scratch their head when it comes to getting rid of Product Comparison feature (RHS box) from their site layout. Although, this feature is default in Magento but their are options which will help you to remove this feature from your Magento store.

With a little bit of PHP knowledge and Magento customization you can easily get rid of Magento Product comparison functionality from your site. Most of the magento installation run cache which will not let you see your changes as you edit the files. It is advised to turn your cache off before induging yourself into the act and turn the cache on once you are satisfied with your changes i.e. removing Magento Product Comparison. You can enable/disable your cache from System -> Cache Management option given in Magento admin panel.

Getting rid of Product Comparison Box and feature

In order to achieve this you need to make changes in 6 different places which are given below:

  1. catalog.xml
  2. reports.xml
  3. customer.xml
  4. addto.phtml
  5. list.phtml
  6. crosssell.phtml

In order to make changes in your catalog.xml file you should open app/design/frontend/deafult/YourTheme/layout/catalog.xml in your favorite PHP editor and delete the following lines of code and save the file.

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

Now open reports.xml file by opening app/design/frontend/deafult/YourTheme/layout/reports.xml in your favorite PHP editor and delete the two lines in am mentioning below. You can search the two lines and delete both of them from reports.xml file.

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

Open customer.xml by editing app/design/frontend/default/YourTheme/layout/customer.xml in your favorite editor and delete the following line of code then save the file.

1
2
3
4
5
<action method="addItemRender">
 <type>grouped</type>
 <block>checkout/cart_item_renderer_grouped</block>
 <template>checkout/cart/sidebar/default.phtml</template>
</action>

Now, save the file and refresh your page and see if the box is still there. Hopefully you should not see the box. There is few more thing left to be done to entirely remove the “Add To Compare” link.

Open addto.phtml by opening app/design/frontend/default/YourTheme/template/catalog/product/view/addto.phtml in your favorite PHP editor and delete the following lines of code and save the file.

1
2
3
4
5
6
< ?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; ?>

Open list.phtml by editing app/design/frontend/default/YourTheme/catalog/product/list.phtml in your favorite PHP editor and delete the following 2 code blocks.

1
2
3
4
<?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
  <span class="pipe">|</span>
  <a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a>
<?php endif; ?>
1
<a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a>

Finally open crosssell.phtml by editing app\design\frontend\default\default\template\checkout\cart in your favorite PHP editor and delete the following lines of code.

1
2
3
4
<?php if($_compareUrl=$this->getAddToCompareUrl($_item)): ?>
 <br/>
 <small><a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare') ?></a></small>
<?php endif; ?>

Now, refresh the page and you won’t see Product comparison instance or its link anywhere on your store. Please leave me a comment and share your experiences of removing Product comparison feature from your Magento powered store. Don’t forget to subscribe to our RSS to receive latest updates delivered to your mailbox for Free!

  • http://www.magentonews.co.uk/magento-development/how-to-get-rid-of-product-comparison-feature-in-magento-magentomagik/ How To Get Rid Of Product Comparison Feature In Magento | MagentoMagik | Magento News

    [...] How To Get Rid Of Product Comparison Feature In Magento | MagentoMagik [...]

  • selphne

    Awesome tutorial! I managed to remove the “compare” feature, but “OR” is still sitting beside “add to cart” button on the product detail page.

    Do you have a solution for that?

    Thank you!

  • http://www.facebook.com/benjamin.ronnenberg Benjamin Ronnenberg

    Awesome post, takes ages to find these kind of changes manually. Also helped to eliminate the whishlist parts in the template as they are usually at the same spot. Thank you!

  • http://www.magentomagik.com/ MagentoMagik

    You are welcome Benjamin, you can follow the same steps to hide/show similar Magento components easily.

  • http://www.magentomagik.com/ MagentoMagik

    Selphne, have you implemented the steps given above properly. I have tested and found no problems at all. “OR” might be coming because you may have missed removing it from the view.

  • selphne

    Hi MagentoMagik,

    It works! After I removed some codes “echo OR” (something like that) from view.phtml
    app/design/frontend/default/default/template/catalog/product

    I got another problem (non-related to this tutorial)… why is that my page showing “'null' is null or not an object” error on Internet Explorer? It doesn't show error on FireFox. I guess I removed something wasn't supposed to be removed!

    http://www.infinidecor.com/

    Your kind assistance is much appreciated.

    Thank you so much again!

    Sincerely,
    Jenny (Selphne)

  • selphne

    Hi MagentoMagik,

    It works! After I removed some codes “echo OR” (something like that) from view.phtml
    app/design/frontend/default/default/template/catalog/product

    I got another problem (non-related to this tutorial)… why is that my page showing “'null' is null or not an object” error on Internet Explorer? It doesn't show error on FireFox. I guess I removed something wasn't supposed to be removed!

    http://www.infinidecor.com/

    Your kind assistance is much appreciated.

    Thank you so much again!

    Sincerely,
    Jenny (Selphne)

  • http://www.google.com marko

    I simply wished to thank you very much once again. I’m not certain what I might have worked on in the absence of the actual tips and hints shared by you over this theme. It absolutely was a frightful matter in my circumstances, nevertheless noticing your professional strategy you treated that made me to jump for fulfillment. Extremely thankful for your information and as well , expect you really know what a powerful job you are always carrying out training some other people through the use of your websites. Most probably you have never got to know any of us.

  • http://magblog.logtech.ru/?p=78 Как избавиться от Compare | Magento Blog

    [...] How To Get Rid Of Product Comparison Feature In Magento | MagentoMagik. Запись опубликована в рубрике Magento с метками продукт, сравнение продуктов. Добавьте в закладки постоянную ссылку. ← Рефреш Inventory Stock Status Direct Download Magento Extension Without Pear → [...]

  • Mtalha

    Hi,

    I did all of the above things and it worked. My magento version is 1.6 and all the things worked except the right bar still has the product compare option. I am not sure why.

  • stefan

    Tried all this and it dose not work for me at all, half of the lines of code you say to edit don’t exist in my files??

  • Alexzhuo

    how to remove to “OR” beside add to cart?

  • Mitch

    This works perfectly in Enterprise 1.11.0.  Good instructions.  @223fe80685d0a27b0ea42dca6941d591:disqus grep the text you are looking for on the server and usually you can just delete it, OR modify your language translation files to omit that line.

  • Avalidemail

    terrible guide. do not follow this because IT DOESNT WORK


Get updates via email:
Subscribe
What is Magik?
We Build beautiful magento themes, powerful extensions and customized backend tools and integration for Magento powered ecommerce store to deliver Amazon like intelligent shopping experiences.



Popular Tags

Categories