I'm trying to extend the "Mage_Catalog_Product_CompareController" class with my own class which is "Invent_Catalog_Product_CompareController" from the core.

But I can't seem to get the results that i am looking for. I suspect the problem on my config xml here is my config.xml

                    <invent_catalog before="Mage_Catalog">Invent_Catalog</invent_catalog>

and here is my CompareController.php

class Invent_Catalog_Product_CompareController extends Mage_Catalog_Product_CompareController

 public function addAction()
      //My Code goes here
  • I assume that you close the <config> tag in config.xml (it is not in the code you provided) and also you have the module declaration file in app/etc/modules and you cleared the cache.
    – Marius
    Apr 24, 2014 at 13:58

1 Answer 1


I think the problem is your require_once statement. It does not include the correct file.


Will include the file Mage/Catalog/controllers/CompareController.php
What you want is Mage/Catalog/controllers/Product/CompareController.php
For this use:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.