
Hi Friends,
Yesterday i was working with Magento Open Source and i am in need to disable the compare products in Magento. Client does not want the compare products functionality of Magento so i have no choice other than disable it.
To disable the Compare products in Magento, follow the below steps.
1) Edit app/code/core/Mage/Catalog/Helper/Product/Compare.php
2) Find below code.
public function getAddUrl($product)
{
return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product));
}
3) Replace with this code.
public function getAddUrl($product)
{
//return $this->_getUrl(’catalog/product_compare/add’, $this->_getUrlParams($product)); return false;
}
4) Edit ./app/design/frontend/base/default/layout/catalog.xml [ Replace default with your theme name]
5) Find below code.
<block type=”catalog/product_compare_sidebar” before=”cart_sidebar” name=”catalog.compare.sidebar” template=”catalog/product/compare/sidebar.phtml”/>
6) Replace with this code.
<!– <block type=”catalog/product_compare_sidebar” before=”cart_sidebar” name=”catalog.compare.sidebar” template=”catalog/product/compare/sidebar.phtml”/> –>
7) Clear the cache from Magento Admin. [System > Cache Management ]
You are Done.



