Hattori Posted August 7, 2016 Share Posted August 7, 2016 Hi!I want to override default template called "form.tpl". It is in: /[admin]//themes/default/template/controllers/cart_rules/ I copied it, modified and placed in: /override/controllers/admin/themes/default/template/controllers/cart_rules/ (i also tried: /modules/[my_module]/views/templates/admin/themes/default/template/controllers/cart_rules/ ). This template is used by AdminCartRulesController: $this->content .= $this->createTemplate('form.tpl')->fetch(); How can I change the path that controller takes this template from? Link to comment Share on other sites More sharing options...
OpenSource Expert Posted August 8, 2016 Share Posted August 8, 2016 You can’t override core theme files. It is not possible in prestashop. You can only override controller and class files. Create a override for the controller and call a different tmp file that you have created in place of core tmp file. Link to comment Share on other sites More sharing options...
Hattori Posted August 9, 2016 Author Share Posted August 9, 2016 Ok, thanks for your reply!Please tell me how can I override controller - eg. AdminCartRulesController. Link to comment Share on other sites More sharing options...
OpenSource Expert Posted August 9, 2016 Share Posted August 9, 2016 You can follow this doc: http://doc.prestashop.com/display/PS16/Overriding+default+behaviors Link to comment Share on other sites More sharing options...
Hattori Posted August 9, 2016 Author Share Posted August 9, 2016 Yes, but this doc describes only manualy overriding. I want to override controller using my module. Link to comment Share on other sites More sharing options...
OpenSource Expert Posted August 9, 2016 Share Posted August 9, 2016 In order to override the Product class, your file needs to be called Product.php and must feature a Product class that then extends ProductCore class. The file can be placed in either of these locations: /override/classes/Product.php /modules/my_module/override/classes/Product.php In order to override the ProductController class, your file needs to be called ProductController.php and must feature a ProductController class that then extends ProductControllerCore class. The file can be placed in either of these locations: /override/controllers/front/ProductController.php /modules/my_module/override/controllers/front/ProductController.php 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