SG Informatica Posted March 17, 2013 Share Posted March 17, 2013 (edited) Hi, I need to send in the orders state the name of products in email template. The order has already been confirmed. What class send the email. Thanks. Edited April 1, 2013 by sginfoocio (see edit history) Link to comment Share on other sites More sharing options...
Radu Posted March 17, 2013 Share Posted March 17, 2013 most of the email variables for changing added to an order are defined in /controllers/admin/AdminOrdersController.php There you should add product data also and then the variables will be available in your mail templates inside mails/en folder Link to comment Share on other sites More sharing options...
SG Informatica Posted March 17, 2013 Author Share Posted March 17, 2013 most of the email variables for changing added to an order are defined in /controllers/admin/AdminOrdersController.php There you should add product data also and then the variables will be available in your mail templates inside mails/en folder Thanks for your reply I´ve created a new state called gift, i wanna send the id order and put {id_order}, {firstname} {lastname}, and works fine. But when i put {products} print {products} not the products of order. I´ve revised the code of AdminOrdersController.php and I don´t see the class which is responsible to send email when the state it´s created for the user in backoffice. Any suggestion? Thanks Link to comment Share on other sites More sharing options...
Radu Posted March 17, 2013 Share Posted March 17, 2013 in AdminOrdersController.php you have the code around if ($history->addWithemail(true, $templateVars)) above it you can place: if ($history->id_order_state == $YOUR_ORDER_STATE_ID) { $templateVars = array('{products}' => $YOUR_LIST_OF_PRODUDCTS); } where $YOUR_LIST_OF_PRODUDCTS is a string build from: foreach ($order->getProducts() as $product) { $YOUR_LIST_OF_PRODUDCTS .= $product['product_name']."<br />"; } *the code is untested and is based on what I noticed in the order controller from backoffice. I can't guarantee this is the right solution. 1 Link to comment Share on other sites More sharing options...
SG Informatica Posted March 17, 2013 Author Share Posted March 17, 2013 in AdminOrdersController.php you have the code around if ($history->addWithemail(true, $templateVars)) above it you can place: if ($history->id_order_state == $YOUR_ORDER_STATE_ID) { $templateVars = array('{products}' => $YOUR_LIST_OF_PRODUDCTS); } where $YOUR_LIST_OF_PRODUDCTS is a string build from: foreach ($order->getProducts() as $product) { $YOUR_LIST_OF_PRODUDCTS .= $product['product_name']."<br />"; } *the code is untested and is based on what I noticed in the order controller from backoffice. I can't guarantee this is the right solution. The code works fine, thanks a lot. Knowing how it works I can adjust to my needs. Thanks again. Link to comment Share on other sites More sharing options...
Radu Posted March 17, 2013 Share Posted March 17, 2013 glad I could help, thank you too Link to comment Share on other sites More sharing options...
Recommended Posts