webtrend Posted August 31, 2016 Share Posted August 31, 2016 Hi, I have an issue with Prestashop 1.6 and I don't know how to solve it. I have created a new status on back office (Orders> Statuses) and I want to use bankwire email template for this status, so I have assigned banwkire email template. Problem is the fact that when I do test to see how the email it looks, bank wire details are not passed as it can be seen below: http://prntscr.com/ccicyw When I do change the status to "Awaiting bank wire payments" email it looks OK, but when I do change back the status to the newly created one, bankwire details are show as tags (as on the screenshot above). Is this a Prestashop bug? Any help will be much appreciated Link to comment Share on other sites More sharing options...
vekia Posted August 31, 2016 Share Posted August 31, 2016 bankwire details are defined only in bankwire module while order process. they will not be added to order state if you will change order status in shop back office so in effect these variables will not be replaced in email 1 Link to comment Share on other sites More sharing options...
webtrend Posted August 31, 2016 Author Share Posted August 31, 2016 Vekia, Thank you for your replay. There is any simple way to add bankwire details to email template to other order status? Do you have any tips or tutorials? Thanks again! Link to comment Share on other sites More sharing options...
rocky Posted September 1, 2016 Share Posted September 1, 2016 Try changing lines 424-432 of classes/orders/OrderHistory.php from: $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference() ); to: $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference(), '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); 4 Link to comment Share on other sites More sharing options...
Wolfar Posted June 27, 2017 Share Posted June 27, 2017 Are you know? When will this error be fixed? Link to comment Share on other sites More sharing options...
PrestaRob Posted May 14, 2018 Share Posted May 14, 2018 Hello, if you need bankwire variables usable in any mail template with any order status, you need to edit file //PrestaFolder/classes/Mail.php Find the line starting with: $template_vars['{color}'] And below that line add this piece of code: /* MK-VISION.CZ BANKWIRE MAIL VARIABLES */ $template_vars['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER'); $template_vars['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS')); $template_vars['{bankwire_address}'] = nl2br(Configuration::get('BANK_WIRE_ADDRESS')); I have tested it with Prestashop 1.6.1.3. Let me know if that helped. Have a nice day. 1 3 Link to comment Share on other sites More sharing options...
Talas Posted July 17, 2019 Share Posted July 17, 2019 On 5/14/2018 at 6:36 PM, PrestaRob said: Hello, if you need bankwire variables usable in any mail template with any order status, you need to edit file //PrestaFolder/classes/Mail.php Find the line starting with: $template_vars['{color}'] And below that line add this piece of code: /* MK-VISION.CZ BANKWIRE MAIL VARIABLES */ $template_vars['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER'); $template_vars['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS')); $template_vars['{bankwire_address}'] = nl2br(Configuration::get('BANK_WIRE_ADDRESS')); I have tested it with Prestashop 1.6.1.3. Let me know if that helped. Have a nice day. Hello, i'm using Prestashop 1.7.5. Your solution doesn't work for my version. Any idea how to solve this problem? Link to comment Share on other sites More sharing options...
vintomax Posted September 17, 2019 Share Posted September 17, 2019 On 7/17/2019 at 3:44 PM, Talas said: Hello, i'm using Prestashop 1.7.5. Your solution doesn't work for my version. Any idea how to solve this problem? Hi Talas, In Presta 1.7, the variable `$template_vars` has been renamed to `$templateVars` (declared and instantiated around line 536 of classes/Mail.php) So you can take what PrestaRob wrote and change the variable name from $template_vars to $templateVars. I have tested this in 1.7.4.2 and there is nothing in the change-logs about mails for the 1.7.5 so this should work fine on your version. Have a nice day. 1 Link to comment Share on other sites More sharing options...
Gipielle Posted April 10, 2020 Share Posted April 10, 2020 Hello, i have reported the bug with prestashop 1.7.6.3 here in github, please help to make undestand prestashop team the this is e problem for merchants: https://github.com/PrestaShop/PrestaShop/issues/18541 Thanks Link to comment Share on other sites More sharing options...
jmm.it Posted April 30, 2021 Share Posted April 30, 2021 On 9/1/2016 at 10:09 AM, rocky said: Try changing lines 424-432 of classes/orders/OrderHistory.php from: $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference() ); to: $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference(), '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); This works fine for me in 1.7.7.3. Put it in a class override so no problem with upgrades. Many thanks to the author! Link to comment Share on other sites More sharing options...
ZiedDams Posted May 9, 2023 Share Posted May 9, 2023 On 5/14/2018 at 5:36 PM, PrestaRob said: Hello, if you need bankwire variables usable in any mail template with any order status, you need to edit file //PrestaFolder/classes/Mail.php Find the line starting with: $template_vars['{color}'] And below that line add this piece of code: /* MK-VISION.CZ BANKWIRE MAIL VARIABLES */ $template_vars['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER'); $template_vars['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS')); $template_vars['{bankwire_address}'] = nl2br(Configuration::get('BANK_WIRE_ADDRESS')); I have tested it with Prestashop 1.6.1.3. Let me know if that helped. Have a nice day. thank you for sharing this solution it work perfectly, just to note some ps version the variable $template_vars is named $templateVars so make sure you modifie the correct one Link to comment Share on other sites More sharing options...
GBPro Posted June 30, 2023 Share Posted June 30, 2023 (edited) On 9/1/2016 at 10:09 AM, rocky said: Try changing lines 424-432 of classes/orders/OrderHistory.php from: $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference() ); to: $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference(), '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) ); This works for me too on Prestashop 1.7.8.5. I put it in an override class. Thank you ! Edited June 30, 2023 by GBPro (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