Question

Today I starting design theme for prestashop and i'm Beginner on that. i have a Question about Theme Module

i have Some module for my new Theme Located here:

prestashop/theme/mytheme/Module

and i want customize that for my new theme.

but the prestashop not using My Module instead using default module Located here:

Prestashop/Module/

What's Wrong and how to Fix this?

Was it helpful?

Solution

From the PrestaShop documentation:

Overriding a module's behavior

The modules are usually in the following format:

  • /modules/my_module/my_module.tpl
  • /modules/my_module/my_module.css
  • /modules/my_module/my_module.js

Since PrestaShop 1.5, they can and should also be in the following format:

  • /modules/my_module/views/templates/front/my_module.tpl
  • /modules/my_module/views/templates/front/my_module.css
  • /modules/my_module/views/templates/front/my_module.js

PrestaShop allows you to override or replace certain front-office module files with new ones within the same theme. The override is governed by the theme: once it contains a /modules folder (or more!), PrestaShop will browse its content for files which have the same name and path as those of existing modules, and replace these with the new ones.

This means, for PrestaShop 1.4-compatible modules:

  • /themes/my_theme/modules/my_module/my_module.tpl
  • /themes/my_theme/css/modules/my_module/my_module.css
  • /themes/my_theme/js/modules/my_module/my_module.js

Since PrestaShop 1.5, the path is slightly longer

  • /themes/my_theme/modules/my_module/views/templates/front/my_module.tpl
  • /themes/my_theme/css/modules/my_module/views/templates/front/my_module.css
  • /themes/my_theme/js/modules/my_module/views/templates/front/my_module.js

In general, the proper path to override a .tpl, .js or .css file depends on the module's own path. That is the reason why if PrestaShop 1.5 has to work with a module without a view folder, it will need the same override path.

In short, you can keep overriding code in 1.5 just as you did in 1.4.

The new files will be used when the customer loads your shop.

Contrary to the override code that is to be placed manually in the /override folder, module overrides are enabled as soon as the module is installed. During installation, overriding code is merge with those already in place (if any), otherwise they are copied to the /override folder at the root of the PrestaShop folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top