Catalog26 Posted June 21, 2010 Share Posted June 21, 2010 Dear all,Is there a way to add one different picture as the logo for each language availableThank you very muchGood DayRespectfully Link to comment Share on other sites More sharing options...
Stefand Posted June 21, 2010 Share Posted June 21, 2010 Yes, i have a solution for that.Contact me please. Link to comment Share on other sites More sharing options...
razaro Posted June 21, 2010 Share Posted June 21, 2010 You need to make small change in header.tpl in your theme folder Add _{$lang_iso} in image source name.So change this code <h1 id="logo"><a href="{$base_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}"><img src="{$img_ps_dir}logo.jpg" alt="{$shop_name|escape:'htmlall':'UTF-8'}" /> to <h1 id="logo"><a href="{$base_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}"><img src="{$img_ps_dir}logo_{$lang_iso}.jpg" alt="{$shop_name|escape:'htmlall':'UTF-8'}" /> and then in your root / img folder reneme logo.jpg to logo_en.jpg for English, logo_fr.jpg for French and similar to other languages you have. Link to comment Share on other sites More sharing options...
rocky Posted June 22, 2010 Share Posted June 22, 2010 Topic moved since it is not a question related to a translation pack Link to comment Share on other sites More sharing options...
Catalog26 Posted June 27, 2010 Author Share Posted June 27, 2010 Thank you 1000 timesThank youI will try this monday Link to comment Share on other sites More sharing options...
Catalog26 Posted June 28, 2010 Author Share Posted June 28, 2010 It works very wellThank you so muchVery respectfully Link to comment Share on other sites More sharing options...
Catalog26 Posted June 29, 2010 Author Share Posted June 29, 2010 Hello,I can't see the logo anymore in the newsletters that i send with my prestashopHow to do please?Thank you very muchHave a good DayRespectfully Link to comment Share on other sites More sharing options...
razaro Posted June 29, 2010 Share Posted June 29, 2010 Yes i didn't think about that, sorry.I think you need logo.jpg for mails and invoices.Do you have one in img folder ? It should be same image as logo_en.jpg Link to comment Share on other sites More sharing options...
Catalog26 Posted June 30, 2010 Author Share Posted June 30, 2010 Yes, Thank you very much, I will do thati found the following code in Prestashop/Modules/blocknewsletter/mails/en/newsletter_conf.html img src="{shop_logo}" alt="{shop_name}" title="{shop_name}" border="0" Can we replace again "logo" by something such as " logo_{$lang_iso} " ?We already did it in header.tpl, can we do it again here?Thank you very muchHave a good dayRespectfully Link to comment Share on other sites More sharing options...
razaro Posted June 30, 2010 Share Posted June 30, 2010 I found these post from rocky It is this code on lines 138 and 139 of classes/PDF.php that adds the logo to the PDFs: if (file_exists(_PS_IMG_DIR_.'/logo.jpg')) $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15); If you want to have a different image in the PDF than on the Front Office, you'll need to put a separate image in the img folder in Prestashop's root (not your theme directory) such as logo-pdf.jpg and change the filename in the code above from logo.jpg to logo-pdf.jpg. No, it is only for the PDF invoices. For emails, you'll need to modify line 94 of classes/Mail.php: $templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : ''; Change logo.jpg to something like logo-email.jpg and put an image with that name in the img directory in the root of Prestashop. And I changed code in PDF.php to (first line with iso variable is new) $iso = Language::getIsoById($cookie->id_lang); if (file_exists(_PS_IMG_DIR_.'/logo_'.$iso.'.jpg')) $this->Image(_PS_IMG_DIR_.'/logo_'.$iso.'.jpg', 10, 8, 0, 15); For Mail.php variable $iso exist so you try this $templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_'.$iso.'.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_'.$iso.'.jpg'))) : ''; I tested for PDF and it works and for Mail i didn't do test but it should work. Link to comment Share on other sites More sharing options...
Catalog26 Posted July 1, 2010 Author Share Posted July 1, 2010 Good morning,It is fantasticIt works very well for PDF and for NewsletterAlthough you have to make sure you have the respective files inin modules/blocknewsletter/mail/For example when i first tried for SPANISH it didnt workedBeause i had not uploaded the spanish newsletter_conf.htmlSo i uploaded all newsletter_conf.html for each languages of my shopAnd now everything works perfectly, Thank you very much for your precious help Thank you very muchHave a very good dayVery respectfully 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