Jump to content

Modual overide issues


devilsown

Recommended Posts

I found this blog. http://www.prestashop.com/blog/article/modules_classes_and_controller_override_by_julien_breux/

 

Module override

 

The modules are usually in the following format:

/modules/mon_module/mon_module.tpl

/modules/mon_module/mon_module.css

/modules/mon_module/mon_module.js

 

PrestaShop allows you to override or replace certain visible module files with new ones with the same theme. It couldn't be simpler, just do the following:

/themes/prestashop/modules/mon_module/mon_module.tpl

/themes/prestashop/css/modules/mon_modules/mon_module.css

/themes/prestashop/js/modules/mon_modules/mon_module.js

 

The new files will be used when you display your website.

 

Ok so i created a /themes/mytemplate/modules/blockcategories/

and i put. blockcategories.tpl in it my site errors out.

 

The only differnce between the stock blockcategories.tpl and mine is i have the the H4 line commented out.

 

 

Do have to have a moduals/css and moduals/js in there even if i don't have modded files?

Link to comment
Share on other sites

You say you "moved" it - does that mean it doesn't exist at the original location any more? It should exist in both places. The correct process is to make a "Copy" or to create a file from scratch with the same name.

 

Paul

Link to comment
Share on other sites

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file '/home/devils/public_html/themes/devilsown/modules/blockcategories/category-tree-branch.tpl'' in /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php:163 Stack trace: #0 /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php(551): Smarty_Internal_Template->isExisting(true) #1 /home/devils/public_html/tools/smarty/compile/e59149d2bad33b82286addd416d5187f93380bc0.file.blockcategories.tpl.php(46): Smarty_Internal_Template->getRenderedTemplate() #2 /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php(433): include('/home/devils/pu...') #3 /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php(568): Smarty_Internal_Template->renderTemplate() #4 /home/devils/public_html/tools/smarty/Smarty.class.php(337): Smarty_Internal_Template->getRenderedTemplate() #5 /home/devils/public_html/classes/Module.php(1030): Smarty->fetch('/home/devils/pu...', ' in /home/devils/public_html/tools/smarty/sysplugins/smarty_internal_template.php on line 163

 

modules/blockcategories/category-tree-branch.tpl

when a tpl calles another tpl file i guesss the 2nd file has to be in the new location too? Or is this a bug, as this file is not modded.

But i have it working I guess not i need to move all my edited files over to it now so i can upgrade my site easier.

Link to comment
Share on other sites

  • 3 months later...

I too have a problem if I put the blockcategories.tpl file in my theme directory as an override. It works if the file is in the modules/bockcategories directory

 

All the other module tpl file overrides I've made work just fine in the theme directory. As an experiment - take the stock blockcategories.tpl file and put it in the themes/prestashop/modules/blockcategories directory and see what happens - it breaks the front page of your shop.

 

Any ideas on how to make this work as an override to make automatic upgrades easier?

Link to comment
Share on other sites

Yes - I get a white screen if the file is in the theme override for that module. All other modules I have with .tpl overrides work fine.

 

I put the file in the path shown for my custom theme and also tried it with the prestashop theme to verify the problem is not due to my custom theme. Try it on a generic shop with the .tpl override in the prestashop theme and see if you have the same problem I do. It does it on two shops I have on differnt servers.

Link to comment
Share on other sites

I found the fix for blockcategories tpl override.

 

If you have blockcategories.tpl in yourtheme/modules/blockcategories directory for override, you also have to put the file category-tree-branch.tpl in the same directory. This clears up the white screen problem on the front page, and allows easier autoupgrade.

 

If this works for devilsown, the subject can be marked as solved!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...