Is it possible to rewrite a controller in a community module that is already rewriting a core controller?

I have the syntax correct as it is working in other rewrites but in this specific case the rewrite is not working.

There is a community module rewriting the cart controller and i want to rewrite the community modules cart controller.

It would be like this:

My Controller -> Community Modules cart controller -> Mage Cart controller

1 Answer 1


This may depend on how the extension is overriding the controller but here goes. You need to add in your module's config.xml file, this as a child of the <config> node.

                    <Your_ModuleNameHere before="Community_ModuleNameHere">Your_ModuleNameHere</Your_ModuleNameHere>

If the community module overrides the cart controller in the same way as described above then it works. If it uses the 'old method' with <from> and <to> tags then it won't work.
(and I have no idea on how to override that).

Make sure that your controller is also named CartController and it's located in Namespace/Module/controllers/CartController.php. Also you might want to make your local module depend on the community module but I don't think this is mandatory. Also make your controller class extend the community module controller.

  • this is precicely what is happening but it will not work. How would one normally debug this? Sep 4, 2013 at 12:53
  • @MartyWallace. I've just tested and it works. But see my update to the answer.
    – Marius
    Sep 4, 2013 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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