Diurne Posted January 6, 2016 Share Posted January 6, 2016 (edited) Hi, I'm currently on a module that will add fields in the AdminOrdersController.php located here : /controller/admin/AdminOrdersController.php So I put the override in my module here : my_module/override/controllers/admin/AdminOrdersController.php <?php class AdminOrdersController extends AdminOrdersControllerCore { public function postProcess() { parent::postProcess(); } public function renderView() { parent::renderView(); } } And I wanted to override the _shipping.tpl located here : /gestion/themes/default/template/controllers/orders/_shipping.tpl So I put in my module a file named _shipping.tpl here : my_module/override/controllers/admin/templates/orders/_shipping.tpl And nothing happen. Edited January 6, 2016 by Diurne (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted January 6, 2016 Share Posted January 6, 2016 _shipping.tpl is not loaded by the controller framework, which means you cannot override it directly. It is included by a different admin theme file, which is... admin\themes\default\template\controllers\orders\helpers\view\view.tpl so you have to override both view.tpl and _shipping.tpl. In view.tpl you will find ... {include file='controllers/orders/_shipping.tpl'} so in your override view.tpl, you would change it to ... {include file='../../_shipping.tpl'} A few notes... 1) You don't have to override the AdminOrder controller for this. 2) The admin themes make use of module hooks, so it is always best to try to use a module hook before you resort to using overrides. So if you are trying to add something to these section, then you may want to use the '$HOOK_CONTENT_SHIP' hook that is defined in _shipping.tpl Link to comment Share on other sites More sharing options...
Diurne Posted January 6, 2016 Author Share Posted January 6, 2016 (edited) Hi bellini13 thank you for your answer, so this is the current module I've made and I still don't see the change I've made on _shipping.tpl, I've made the change as you said and I still don't see any change, any ideas ? Edited January 6, 2016 by Diurne (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted January 6, 2016 Share Posted January 6, 2016 well you have to install the module and confirm that your override files are actually moved to the correct overrides folder during the install process. Link to comment Share on other sites More sharing options...
Diurne Posted January 7, 2016 Author Share Posted January 7, 2016 I got the AdminOrderController but templates no. Link to comment Share on other sites More sharing options...
Diurne Posted January 7, 2016 Author Share Posted January 7, 2016 When I put all my files template into the override folder I can see my modifications but smarty variables I added in the override cannot be found. Link to comment Share on other sites More sharing options...
bellini13 Posted January 7, 2016 Share Posted January 7, 2016 did you delete and re-create your cache/class_index.php after installing the controller override file? have you considered using module hooks instead of overrides? Link to comment Share on other sites More sharing options...
Diurne Posted January 7, 2016 Author Share Posted January 7, 2016 Yes I deleted the class_index.php after installing the controller. I considered using hooks but I modify the current style by modifying input and adding a select on the order carrier to modify it. Link to comment Share on other sites More sharing options...
bellini13 Posted January 7, 2016 Share Posted January 7, 2016 your module can include javascript and styling, it doesn't have to override a template file for that. as to why it's not working for you, I can't pretend to know what you coded... 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