Latest Posts
Home =>> Fix Error =>> Fix Magento Error =>> How to Disable Compare Products Functionality
disable compare products in magento,Removing Product Comparison in Magento,magento 2 disable add to compare,disable compare products magento 2,magento disable add to wishlist compare

How to Disable Compare Products Functionality

For the Magento beginners this task may become tougher for them because there is no direct option available to removing product comparison.No worries you just follow twos steps to disable compare products in magento.Those are
1.Edit Compare.php file
2.Edit catalog.xml file
No other coding knowledge is required to edit the above files.You just copy and paste the codes or replace the code with new one that we’ve provided here.Let us go with Compare.php file.

1.Edit Compare.php :

Locate this compare.php file at  app/code/core/Mage/Catalog/Helper/Product/Compare.php  and edit the file and locate the below mentioned line of code.

public function getAddUrl($product){return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product));}

Replace above line with below code in compare.php.Nothing you are doing here,you are just putting that comparing  functionality into comments or making it disable.

public function getAddUrl($product){//return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product)); return false;}

That’s it save the file and now edit catalog.xml file

2.Edit Catalog.xml file :

Locate this catalog.xml file at ./app/design/frontend/base/default_theme_name/layout/catalog.xml . You have to notice that default_theme_name is your installed Magento theme name. Now edit catalog.xml file and locate below mentioned code and put it into comments or disable them.

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

Replace with below code

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

That’s it you are alomost done.You just need to clear cache form Cache Management.To do that go to  admin area >System > Cache Management. We hope this article is helped you to disable the product comparing functionality.Please share the same on facebook.“Happy Coding.!”

Leave a Reply


Check Also

Some Google Tips Here

Hi Guys Find Below Link You Find Some Tips & Tricks   Google Tips & Tricks   Thank You For Watching. More Updates Tricks & Tips Coming Soon.