Freelance PHP Developer | Freelance PHP Programmer | PHP Freelance | Freelance Developer | PHP Freelancer | PHP Freelance Developers | PHP Developers | Freelance Developers | PHP Developer

[Magento] Disable Compare products functionality

magento-ecommerce

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 ]

8) You are Done.

      
Tweet
You can leave a response, or trackback from your own site.
  • James

    I modified what you say in the tutorial and the menu just desappeared, cant go to any category page.

  • James

    Resolved…

PHP Freelance | Freelance Developer | PHP Developer | PHP Freelancer | Freelance Developers | PHP Developers
Freelance PHP Developer