Dave Riley Posted November 25, 2013 Share Posted November 25, 2013 PS: 1.5.6.1 I'm trying to override AdminOrdersController, specifically the class's constructor in order to add a column for shipping to the orders list. I created a copy of controllers\admin\AdminOrdersController.php and put it in \override\controllers\admin. I changed the class definition at the top from: class AdminOrdersControllerCore extends AdminController to: class AdminOrdersController extends AdminOrdersControllerCore then added in my extra column (BTW if I just edit AdminOrdersController.php in place the added column works fine though in this case I obviously don't change the class definition). I deleted cache\class_index.php and refreshed the orders page but the new column didn't show up. What am I doing wrong? Thanks! Dave Link to comment Share on other sites More sharing options...
Dave Riley Posted November 29, 2013 Author Share Posted November 29, 2013 No-one? Link to comment Share on other sites More sharing options...
chesspiece423 Posted October 2, 2014 Share Posted October 2, 2014 I have this problem too. I can override other controllers but not the AdminOrdersController.php. I wonder why. Deleting cache\class_index.php seems not to work either Sorry for the necrobump. Link to comment Share on other sites More sharing options...
vekia Posted October 2, 2014 Share Posted October 2, 2014 perhaps file is located in wrong directory? where your override is stored? can you show the path to the override? Link to comment Share on other sites More sharing options...
Radu Posted January 28, 2015 Share Posted January 28, 2015 I encountered several things: - check override path - check class name With debug mode turned on you can also modify the cache/class_index file directly having something like this: 'AdminFeaturesController' => array ( 'path' => 'override/controllers/admin/AdminFeaturesController.php', 'type' => 'class', 'override' => true, ), in order to force an override Link to comment Share on other sites More sharing options...
David_Presta Posted April 19, 2015 Share Posted April 19, 2015 (edited) Just in case somebody find this usefull, I followed the same steps that Dave wrote and I got override the class AdminOrdersControllerCore, the only difference I see is I'm working on PS 1.6 Path of core class: controllers/admin/AdminOrdersController.php Path of override class: override/controllers/admin/AdminOrdersController.php Main definition override class class AdminOrdersController extends AdminOrdersControllerCore Edited April 19, 2015 by David_Presta (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now