1
votes

I usually buy themes at ThemeForest for prestashop, and I want receive updates for themes. But sometimes i need modify couple .tpl from theme.

I found in documentation the "file structure" of a module. And exist a folder called /themes/[theme_name]/modules. It is used for "Sub-folder for overriding .tpl files and languages files, if necessary." It looks like only for override modules inside of theme.

My Question:
There are any way of override the .tpl of theme root folder using a module?.

This way I updated theme from themeforest without problems and after i can reinstall my module for customization of theme.

My Solution by now:
The only way I found, and I do not like, is to create another copy of a theme.

but then not be able to receive updates of theme

2
Please check link might get help stackoverflow.com/a/54457507/2769372 - Shobhit Verma

2 Answers

1
votes

You can't override a theme for now. This functionality will be introduced in Prestashop 1.7 currently in development.

If you create a new module you will not be able to override default template files defined by the core. Or you'll have to override core controllers to use your templates then you'll lose core updates.

The simplest way to do so for now is to copy the theme and after each updates check for changes and report those changes into your copy...

1
votes

Florian's answer is absolutely correct and until PS 1.7 certainly the recommended way to go.

I Just wanted to throw in that, if your changes are likely to be far fewer than those of theme updates, it could be worthwhile to create modified templates, say product_mod.tpl, and then override the initContent() function in the controller to show your modified template. You would then only need to compare the changes for the files you modified.

But, this would only be worthwhile if your modifications are much fewer than the changes in theme updates.