3

I have copied app/code/core/Mage/Checkout/controllers/OnepageController.php to app/code/local/Mage/Checkout/controllers/OnepageController.php and overrided one function. I have also refreshed caches, but overrided controller is not called, instead original controller is called.

Why isn't my override working? I have done same kind of override for other core files and that worked well.

newbie
  • 24,286
  • 80
  • 201
  • 301
  • 3
    Controller files are not (cannot be) included by the autoloader, hence the include path precedence does not apply. – benmarks Oct 30 '12 at 12:03

1 Answers1

3
  1. Is compilation turned off?

  2. Try creating your own controller to overriding a core controller instead of copying and editing a Magento core file.

http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/how_to_overload_a_controller

See also: How can I override a Magento controller?

Community
  • 1
  • 1
Edd
  • 683
  • 1
  • 11
  • 21
  • 1. Compilation is turned off. 2. I created own controller, but it ruined something else, so I figured out that it would be easier to just override it like that. – newbie Oct 30 '12 at 08:39
  • Is your OnepageController already overridden/extended by some other module? – Edd Oct 30 '12 at 08:43
  • No it's not, I checked this form Eclipse and even added debug to original file and original file with debug was called. – newbie Oct 30 '12 at 08:46
  • 2
    I managed to override controller with changes to my own module config.xml, I had to use line My_Module. Apparently you cannot override files in controllers folder. – newbie Oct 30 '12 at 08:53