Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - local controller is not working

I have a question regarding Magento's local directory.

I am trying to override a core controller - Mage/Contacts/controllers/IndexController.php.

So I copied IndexController.php to /app/local/Mage/Contacts/controllers/

but Magento is still using core file. I can confirm it because I see 404 page when I rename Mage/Contacts/controllers/IndexController.php to IndexController.php_.

Please advise me.

Thanks!

like image 772
Moon Avatar asked Sep 28 '10 01:09

Moon


1 Answers

Copying a controller into the app/code/local path doesn't work unfortunately due to Magento's autoload architecture. It does work with Blocks, Models and other objects, but not controllers.

There is a detailed walkthrough of how to override a controller on the wiki. And a blog post by @prattski

Try following those, then come back with any specific questions.

HTH, JD

like image 94
Jonathan Day Avatar answered Oct 17 '22 13:10

Jonathan Day