abdumalik LiteCart Fan از کشور Sweden عضو از اکتبر 2021 abdumalik 12 مارس 2023 17:31 Hi there I try to use HTML in this $message, everything is ok without the translation method. When I use language::translate() method after $message. I will receive only text, all HTML codes have gone inside the text. $css = file_get_contents(FS_DIR_TEMPLATE . 'css/email_template.css'); $message = "<html><head><style>".$css."</style></head><body> <div class='email-main'> <div class='email-date'>".date('h:i - m, d, Y')."</div> <div class='email-message'> <div class='email-header'> <a href='#'><img src='".$url."/images/email_header.jpeg' class='email-header-bg'></a> </div> <div class='email-text'> <p style='color: black;'>Thank you for your purchase!</p></br></br> <p>Your order #%order_id has successfully been created with a total of %payment_due for the following ordered items:</p></br></br> <p>%order_items</p></br></br> <p>A printable order copy is available here:</p></br> <p>%order_copy_url</p></br> <p>Regards,</p></br> <p>%store_name</p></br> <p>%store_url</p></br> </div> <div class='email-footer'> <a href='#'><img src='".$url."/images/email_footer.jpeg' class='email-footer-bg'></a> </div> </div> </body></html>"; $message = strtr(language::translate('email_order_confirmation', $message, $language_code), $aliases);``` Is there a any solution for this problem ?
s22_tech Moderator از کشور United States عضو از اکتبر 2019 s22_tech 12 مارس 2023 19:44 I just tested it under 2.5.2 and it works for me. Which version are you using? I just thought of something. Perhaps you already have a translation named "email_order_confirmation"? If so, LiteCart won't overwrite it — you'll need to delete it first in the admin. Once you do that, it should be saved properly.
tim Founder از کشور Sweden عضو از مهٔ 2013 tim 12 مارس 2023 20:26 You need to enable HTML for the translation key.
abdumalik LiteCart Fan از کشور Sweden عضو از اکتبر 2021 abdumalik 12 مارس 2023 21:15 it's 2.4.4 on me, it worked. Thank you guys.