Soufyan Amenzou Posted January 16, 2013 Share Posted January 16, 2013 (edited) Hi everybody, I would like to overloading or override a back-office template. The template is this one : admin170/themes/template/controllers/products/prices.tpl In my modules I put my tpl file in thhis location => my_module/override/controllers/admin/templates/products/prices.tpl To test my tpl file, I put only few code [/font][/color] [color=#000080][font=verdana, geneva, sans-serif][/font][/color] [color=#000080][font=verdana, geneva, sans-serif]{extends file="products/prices.tpl"} {block name="after"} <p style="color:red;text-align:center;">Block after : add a text after the form</p> {/block} I saw this example in confluence documentation prestashop 1.5 => http://doc.prestasho...office+template But I got nothing even if I uninstall and reinstall my module For information I managed to override the AdminProductsController.php. How ? In my module I create file in this location => my_module/override/controllers/admin/AdminProductsController.php which extend AdminProductsControllerCore Now I'm trying to override a tpl file. I hope my topic is clear, Best regards. Soufyan Edited January 16, 2013 by soufyan (see edit history) Link to comment Share on other sites More sharing options...
daur88 Posted January 18, 2013 Share Posted January 18, 2013 (edited) Hello, You should uninstall and reinstall your module again, because prestashop copies everything, located in moduleName/override folder into prestashop/override. So ultimately your prices.tpl file must be placed in prestashop/override/controllers/admin/templates/products. UPD Sorry, but my first post was little bit misleading. Prestashop copies only php files located in moduleName/override. So you should have put your prices.tpl right into prestashop/override/controllers/admin/templates/products and not into your module's override folder. Edited January 18, 2013 by daur88 (see edit history) Link to comment Share on other sites More sharing options...
lucster88 Posted January 24, 2013 Share Posted January 24, 2013 daur88: your answer is quite right, but just to develop your module so that chnages can take effect immediatly. But when you then have to install the module, the tpl-files should also be copied to the right place, and this is where the problem is. Hope for changes from Prestashop team. 1 Link to comment Share on other sites More sharing options...
luchiniii Posted January 29, 2013 Share Posted January 29, 2013 Hello I'm trying to override prestashop15\site-admin\themes\default\template\controllers\orders\_customized_data.tpl and I have copied it into this path: prestashop15\override\controllers\admin\templates\orders\_customized_data.tpl but I can't see any changes, could please tell me the right way to do this? Link to comment Share on other sites More sharing options...
Daniel - PrestaBR Posted March 25, 2013 Share Posted March 25, 2013 up Link to comment Share on other sites More sharing options...
marcis Posted March 28, 2013 Share Posted March 28, 2013 Same problem here! Link to comment Share on other sites More sharing options...
Enrique Gómez Posted March 31, 2013 Share Posted March 31, 2013 Have you tried disabling the cache? Link to comment Share on other sites More sharing options...
marcis Posted April 3, 2013 Share Posted April 3, 2013 Yes Link to comment Share on other sites More sharing options...
Enrique Gómez Posted April 3, 2013 Share Posted April 3, 2013 (edited) You are right, I have the same problem with tpl begining with _. So I'm digging a little and those templates are included in another parent tpl. In the case of _customized_data.tpl is the orders/helpers/view/view.tpl I think you must override view.tpl and then change in some way {include file='controllers/orders/_customized_data.tpl'} Edit: It'worked for me. But i had to put _customized_data.tpl in the same folder of view.tpl and use {include file='./_customized_data.tpl'} Edited April 3, 2013 by egomezpe (see edit history) 1 Link to comment Share on other sites More sharing options...
Enrique Gómez Posted April 3, 2013 Share Posted April 3, 2013 I've forgot to mention that you can use ../ to go to parent directory. And most important, i've lost the translations of the administration orders page (now i see them in english). But it seems to be a general problem when overwriting admin templates. Link to comment Share on other sites More sharing options...
Daaaaad Posted February 3, 2014 Share Posted February 3, 2014 I have the same problem. The solution from Enrique Gómez is working but could we have the feedback from Prestashop ? Link to comment Share on other sites More sharing options...
Rolige Posted March 6, 2014 Share Posted March 6, 2014 Just a comment for prestashop team, because the problem with the override files on the back office is still there in the latest versions. Link to comment Share on other sites More sharing options...
cikcak Posted March 5, 2015 Share Posted March 5, 2015 Same problem.. So only one way to override view.tpl and change path of __ file? Link to comment Share on other sites More sharing options...
mcdado Posted September 15, 2015 Share Posted September 15, 2015 I copied the files view.tpl and _product_line.tpl, changed the path as described above in view.tpl. It works, but to make things nicer I had to implement this method in my module: private function installCustomTemplates() { $this->custom_templates = array( 'override/controllers/admin/templates/orders/helpers/view/view.tpl', 'override/controllers/admin/templates/orders/helpers/view/_product_line.tpl', ); $success = true; foreach ($this->custom_templates as $ct) { $destination = _PS_ROOT_DIR_.'/'.$ct; $custom_template = $this->local_path.$ct; // @TODO: this should be improved by adding ability to report errors if (!Tools::file_exists_cache($destination) && Tools::file_exists_cache($custom_template)) { $template_directory = dirname($destination); if (!Tools::file_exists_no_cache($template_directory)) { $success = $success && @mkdir($template_directory, 0755, true); } $success = $success && @copy($custom_template, $destination); do { if (Tools::file_exists_cache(_PS_ROOT_DIR_.'/config/index.php') && !Tools::file_exists_cache($template_directory.'/index.php')) { $success = $success && @copy(_PS_ROOT_DIR_.'/config/index.php', $template_directory.'/index.php'); } $template_directory = dirname($template_directory); } while (strlen(_PS_ROOT_DIR_) < strlen($template_directory)); } } return $success; } 1 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