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

Ponas

Well-known member
XNullUser
Joined
Jan 17, 2022
Messages
1,301
Reaction score
96
Points
48
NullCash
623
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
195
Reaction score
12
Points
18
NullCash
91
Thanks for your work, i try it on my test store
 
Top