v1.7-v8x Prestashop 8 - child theme translation issue fix

Ponas

Well-known member
Diamond
Elite
XNullUser
Joined
Jan 17, 2022
Messages
1,386
Reaction score
130
Points
63
NullCash
2
Prestashop 8. If you are using a child theme, then you may encounter a translation issue, here is a fix.

The problem is a bug in Prestahshop 1.7.8.8 and Prestashop 8, Prestashop native translation system can’t work fine in the child theme, please Modify the /src/PrestaShopBundle/Translation/Loader/SqlTranslationLoader.php file to resolve the problem.

Replace the code

($this->theme !== null ? '= "' . $this->theme->getName() . '"' : 'IS NULL')

with

($this->theme !== null ? ' IN ("' . $this->theme->getName() . '"'.($this->theme->get('parent') ? ',"' . $this->theme->get('parent'). '"' : '').')' : 'IS NULL')

See the enclosed screenshot.
Don’t forget to clear the Smarty cache.
Best regards.
 

Attachments

  • prestashop-translations-not-workin-fix.jpg
    prestashop-translations-not-workin-fix.jpg
    67.1 KB · Views: 1

emrys

Member
XNullUser
Joined
Jul 22, 2022
Messages
199
Reaction score
13
Points
18
NullCash
2
Thanks for your work, i try it on my test store
 
Top