Monday, January 2, 2012

How to disable the Compare products functionality

You can disable the Compare products functionality in Magento by following these steps:

    Edit app/code/core/Mage/Catalog/Helper/Product/Compare.php and change the following code:

public function getAddUrl($product)

{

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

}

to

public function getAddUrl($product)

{

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

}

    Edit ./app/design/frontend/base/default/layout/catalog.xml (if you are using a different Magento theme, enter its name instead of default) and change the following code:

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

to

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

    Flush the Magento cache from your Magento admin area > System > Cache Management.

2 comments:

  1. Here is the free extension that allows to disable product compare functionality in Magento http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16044/

    ReplyDelete
  2. Hmmmm...
    exactly the same as
    http://www.siteground.com/tutorials/magento/magento_issues.htm
    even down to the double space in: "Edit app/code/"

    ReplyDelete