Prestashop: Module override not working with child themes

Created on 21 May 2020  路  3Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

It's not possible to override a module template within a child theme. The template files override works fine but the module templates got mixed up. It seems that the smarty cache use the latest version of the theme (Parent or child).

Let's say you have theme A wich is a parent of Theme B . you have an override for module ps_emailsubscription on Theme A (Parent) and you also have an override for the same module template file on theme B (Child) then when you access the frontend for the theme A you can see the override created on theme B.

It might be related to the smarty cache for the template file that is not creating the cache on the child theme folder structure.

Expected behavior

The expected behavior is to be able to override the modules on a child theme exactly as the template overrides having two different versions of the module template, one for each theme.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a multistore with two frontends URL
  2. Create a child theme with the basic YML structure.
  3. Assign the parent theme to one of the frontend (shop 1) and the child to frontend (shop 2)
  4. create an override for any module tpl on the parent theme
  5. Create an override for the same module tpl on the child theme
  6. Access both frontends and you should see the same override on both frontends

Screenshots

If applicable, add screenshots or screen recordings to help explain your problem.

Additional information

  • PrestaShop version: 1.7.6.1
  • PHP version: 7.1.33-14+ubuntu18.04.1+deb.sury.org+1
CO No change required Theme & logo

Most helpful comment

Can you test with PrestaShop 1.7.7 beta?
It should be fixed with #14727 & #13804

It seems to be working fine on 1.7.7 beta, however I can't use it on production yet.

I have created an override for classes/controller/FrontController.php with the fix https://github.com/PrestaShop/PrestaShop/pull/13804/commits/7a03159ed7b6d3df5e867cdfe44c05ce07bbf3b7#diff-a5aacc71d32391733634cc71652c7bc7 and it's working fine.

Thank you for your help !

All 3 comments

Thanks for opening this issue! We will help you to keep its state consistent

Can you test with PrestaShop 1.7.7 beta?
It should be fixed with #14727 & #13804

It seems to be working fine on 1.7.7 beta, however I can't use it on production yet.

I have created an override for classes/controller/FrontController.php with the fix https://github.com/PrestaShop/PrestaShop/pull/13804/commits/7a03159ed7b6d3df5e867cdfe44c05ce07bbf3b7#diff-a5aacc71d32391733634cc71652c7bc7 and it's working fine.

Thank you for your help !

Was this page helpful?
0 / 5 - 0 ratings