As demonstrated in this 4 year old document on Magento's site: https://wiki.magento.com/pages/viewpage.action?pageId=10223961

I've used this method in past years and it has worked. Copy directory path and specific file you would like to overwrite to the same location but in "local" instead of "core". Now I'm seeing information that states otherwise and it definitely isn't working in CE 1.9.


Note: CartController.php is the file/controller I'm working with.


This is a crappy custom. You need to avoid this. A magento developer should follow best practises.

As per the best practices, if you need to extend or modify a core controller method, then you should rewrite that core controller class with a simple extension. Again if you can utilize any event to do the task, then you should give preference to the observer event.

Follow this post for getting familiarize with how to do a rewrite.

For an example, you can rewrite CartController.php like this.

File : app\code\local\Namespace/Module/etc/config.xml

                        <namespace_module before="Mage_Checkout">Inchoo_Tag</namespace_module>

and now you should define rewrite class for CartController inside your module.

File : app\code\local\Namespace/Module/controllers/CartController.php


class Namespace_Module_TagController extends Mage_Checkout_CartController
    // your custom rewrite codes comes here

That's it. Remember always follow magento best practices.

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.