I'm busy working though Grokking Magento by Vinai Kopp, and reached a part where he explains where he explains how to rewrite requests to (eg) the checkout/cart controller, and he gives an example of the config.xml, like this:

<!-- global only (not frontend or adminhtml) -->
        <!-- route name -->
                <!-- controller name -->
                    <!-- rewrite all controller actions -->

This all seems straightforward enough, except that I have recently also watched the TutsPlus Magento Fundamentals videos, where they take you through an example of overwriting a controller, and their config.xml looks completely different eg:

            <Envato_Catalog before="Mage_Catalog">TutsPlus_Demo</Envato_Catalog>

This is also pretty straightforward, but my problem here is that these 2 very different configs doing (seemingly) the same thing - could anyone please shed some light on this situation for me? I am trying to get the hang of Magento and this one is confusing me a LOT!

1 Answer 1


The second one has been introduced somewhere between Magento 1.4 and 1.5 and is since then the preferred way.

It also has more flexibility, with this configuration any module can add itself as listener to a route and they are matched in order of priortiy until the requested controller action is found.

The first one is the old way, still works but is not recommended anymore. It rewrites the whole controller class, so your own class must implement all existing methods or extend the original controller. Also there will be conflicts if several modules try to rewrite the same controller.

More info: https://magento2.atlassian.net/wiki/display/m1wiki/How+To+Overload+a+Controller (apparently the new feature actually has been introduced in Magento 1.3 already)

  • Thanks, I will mark this as accepted soon (I have to wait another 5 minutes). Is there any specific reason why the first method is no longer preferred?
    – Skytiger
    Apr 22, 2016 at 10:15
  • Please ignore me previous comment, apparently my reading comprehension is not quite up to par today, you already explained the reason for the change sufficiently :)
    – Skytiger
    Apr 22, 2016 at 10:20
  • @Skytiger I added some more info on the differences nonetheless :) Apr 22, 2016 at 10:23

Your Answer

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

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