Krid.Ji Posted August 4, 2021 Share Posted August 4, 2021 (edited) Dear community, I have started to use prestashop for create marketplace. But there are few issues that occurred to user. For example, when customer placed their order in the system. But the address text (Thai language) cannot render on invoice PDF and exported orders (see attached). The database charset and collation are support UTF-8, so on website, the text can display flawlessly. Any suggestion of configuration to proceed? PS. I need to opt-out the Thai language as web, because SEO plays tricks with url/th/[some_translated_text_that_fail_to_go_home] Best regards, Krid Ji Edited August 4, 2021 by Krid.Ji Censor some info from screenshot (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 4, 2021 Share Posted August 4, 2021 Hello, which version of PrestaShop you are using. and what is the php version of your hosting. Thank you Link to comment Share on other sites More sharing options...
Krid.Ji Posted August 4, 2021 Author Share Posted August 4, 2021 3 hours ago, SmartDataSoft said: Hello, which version of PrestaShop you are using. and what is the php version of your hosting. Thank you Hi, I'm using Prestashop version 1.7.7.5, and PHP is 7.3.28 Thanks! Link to comment Share on other sites More sharing options...
Krid.Ji Posted August 5, 2021 Author Share Posted August 5, 2021 Hi, I'm using Prestashop version 1.7.7.5, and PHP is 7.3.28 Thanks! Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 5, 2021 Share Posted August 5, 2021 Hello, database need utf8_general_ci you can open your database in phpmyadmin and edit a table data and insert your text manually as check after save it show in database. if database is not set utf8_general_ci in that case it made problem Thank you Link to comment Share on other sites More sharing options...
Krid.Ji Posted August 6, 2021 Author Share Posted August 6, 2021 Hi, Thank you for your response, but I have checked my database. And both charset and collation are utf8 and utf8_general_ci since beginning. But the result still show as the original question post. Do you know where should I look to solve this issue? Best regards Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 6, 2021 Share Posted August 6, 2021 (edited) @Krid.Ji For you i finally able to solve the issue. Open this file /1.7.7.0/classes/pdf/PDFGenerator.php line no 32 const DEFAULT_FONT = 'freeserif'; set this font in place of const DEFAULT_FONT = 'helvetica'; then same file line 138 function setFontForLang comment first 5 line and put the last line and then check it will show like this image // if (array_key_exists($iso_lang, $this->font_by_lang)) { // $this->font = $this->font_by_lang[$iso_lang]; // } else { // $this->font = self::DEFAULT_FONT; // } $this->font = self::DEFAULT_FONT; N.B: In my case i have to comment this 5 line, because when i print invoice from back end the code is missing. you can check from customer front end without comment this 5 line, if pdf print fine. only the first change that is fine. The code describe, the pdf add font depand on customer langauge. You can set the default font to freeserif for thai Thank you Edited August 6, 2021 by SmartDataSoft (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now