How to disable the Compare products functionality in Magento?

Disable compare product functionality follow below mentioned steps.

  • Login to your Cpanel.
  • Click on File Manager
  • Open your root folder and open compare.phtml file from below path
    • app/code/core/Mage/Catalog/Helper/Product/Compare.php

In this file you will see below code

<<CODE>>

public function getAddUrl($product)

{

return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product));

}

Replace above code with below code in compare.phtml file.

<<CODE>>

public function getAddUrl($product)

{

//return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product)); return false;

}

Now, you have to edit in another file, that is called catalog.xml

Path for change another file: ROOT/app/design/frontend/base/default/layout/catalog.xml

. Don’t forget to use your theme name if you are not using a default one .Please find the below code.

<<CODE>>

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

Replace below code in catalog.xml file.

<<CODE>>

<!– <block type=”catalog/product_compare_sidebar” before=”cart_sidebar” name=”catalog.compare.sidebar”

template=”catalog/product/compare/sidebar.phtml”/> –>

Once all are done, clear the Magento Cache from admin panel.

 

Leave a Reply

Your email address will not be published. Required fields are marked *