Jump to content

[SOLVED]Send name products in order status


Recommended Posts

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

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

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.

  • Like 1
Link to comment
Share on other sites

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

×
×
  • Create New...