parat10 Posted January 29, 2014 Share Posted January 29, 2014 Hello, I need to add new data field with products to shipped email template. If i add {products} or {items} to templete nothing happens. I even try to modify /tabs/adminOrders and add '{products}' => $productsList, '{items}' => $itemsTable, to TemplateVars but still nothing. Thanks PrestaShop™ 1.4.10.0 Link to comment Share on other sites More sharing options...
parat10 Posted January 30, 2014 Author Share Posted January 30, 2014 Have anyone some idea? Please? Link to comment Share on other sites More sharing options...
parat10 Posted February 7, 2014 Author Share Posted February 7, 2014 Still can`t figure it out. Anyone? Link to comment Share on other sites More sharing options...
parat10 Posted March 4, 2014 Author Share Posted March 4, 2014 really anyone? Link to comment Share on other sites More sharing options...
Scully Posted August 22, 2014 Share Posted August 22, 2014 I also would appreciate a solution to this question. Thanks for any help. Scully Link to comment Share on other sites More sharing options...
HiPresta Posted January 7, 2015 Share Posted January 7, 2015 In AdminOrdersController.php on line ~352 find this code: if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number) $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url)); and replace it with this one if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number){ $products_list = ''; $products = $order->getProducts(); foreach ($products as $key => $product){ $price = Product::getPriceStatic((int)$product['product_id'], false, ($product['product_attribute_id'] ? (int)$product['product_attribute_id'] : null), 6, null, false, true, $product['product_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $price_wt = Product::getPriceStatic((int)$product['product_id'], true, ($product['product_attribute_id'] ? (int)$product['product_attribute_id'] : null), 2, null, false, true, $product['product_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $customization_quantity = 0; $customized_datas = Product::getAllCustomizedDatas((int)$order->id_cart); if (isset($customized_datas[$product['product_id']][$product['product_attribute_id']])){ $customization_text = ''; foreach ($customized_datas[$product['product_id']][$product['product_attribute_id']][$order->id_address_delivery] as $customization){ if (isset($customization['datas'][Product::CUSTOMIZE_TEXTFIELD])) foreach ($customization['datas'][Product::CUSTOMIZE_TEXTFIELD] as $text) $customization_text .= $text['name'].': '.$text['value'].'<br />'; if (isset($customization['datas'][Product::CUSTOMIZE_FILE])) $customization_text .= sprintf(Tools::displayError('%d image(s)'), count($customization['datas'][Product::CUSTOMIZE_FILE])).'<br />'; $customization_text .= '---<br />'; } $customization_text = rtrim($customization_text, '---<br />'); $customization_quantity = (int)$product['customization_quantity']; $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['product_name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').' - '.Tools::displayError('Customized').(!empty($customization_text) ? ' - '.$customization_text : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.$customization_quantity.'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice($customization_quantity * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; } if (!$customization_quantity || (int)$product['product_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['product_name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod((int)$this->context->customer->id) == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.((int)$product['product_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['product_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; } $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{products}' => $products_list); } Then in shipped.html add {products} where you want to display the products list. Link to comment Share on other sites More sharing options...
odeen Posted May 11, 2015 Share Posted May 11, 2015 In AdminOrdersController.php on line ~352 find this code: if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number) $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url)); and replace it with this one if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number){ $products_list = ''; $products = $order->getProducts(); foreach ($products as $key => $product){ $price = Product::getPriceStatic((int)$product['product_id'], false, ($product['product_attribute_id'] ? (int)$product['product_attribute_id'] : null), 6, null, false, true, $product['product_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $price_wt = Product::getPriceStatic((int)$product['product_id'], true, ($product['product_attribute_id'] ? (int)$product['product_attribute_id'] : null), 2, null, false, true, $product['product_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $customization_quantity = 0; $customized_datas = Product::getAllCustomizedDatas((int)$order->id_cart); if (isset($customized_datas[$product['product_id']][$product['product_attribute_id']])){ $customization_text = ''; foreach ($customized_datas[$product['product_id']][$product['product_attribute_id']][$order->id_address_delivery] as $customization){ if (isset($customization['datas'][Product::CUSTOMIZE_TEXTFIELD])) foreach ($customization['datas'][Product::CUSTOMIZE_TEXTFIELD] as $text) $customization_text .= $text['name'].': '.$text['value'].'<br />'; if (isset($customization['datas'][Product::CUSTOMIZE_FILE])) $customization_text .= sprintf(Tools::displayError('%d image(s)'), count($customization['datas'][Product::CUSTOMIZE_FILE])).'<br />'; $customization_text .= '---<br />'; } $customization_text = rtrim($customization_text, '---<br />'); $customization_quantity = (int)$product['customization_quantity']; $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['product_name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').' - '.Tools::displayError('Customized').(!empty($customization_text) ? ' - '.$customization_text : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.$customization_quantity.'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice($customization_quantity * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; } if (!$customization_quantity || (int)$product['product_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['product_name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod((int)$this->context->customer->id) == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.((int)$product['product_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['product_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; } $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{products}' => $products_list); } Then in shipped.html add {products} where you want to display the products list. This is not functional for me (PS 1.6.14) - when i set order in status "shipped", than i have blank white screen. I have read almost all the threads at prestashop forums and i have not found a solution to add {products} to order statuses i want to... why i cannot simply use order_conf_product_list.tpl by calling in any .html ? Or better how i can achieve this - please. Link to comment Share on other sites More sharing options...
Vali16 Posted March 18, 2016 Share Posted March 18, 2016 This is not functional for me (PS 1.6.14) - when i set order in status "shipped", than i have blank white screen. I have read almost all the threads at prestashop forums and i have not found a solution to add {products} to order statuses i want to... why i cannot simply use order_conf_product_list.tpl by calling in any .html ? Or better how i can achieve this - please. Hi, Have you found a solution to add {products} to any order status email. I wanted to create a new status, specify an email template that includes product details, but it shows {products} instead of actual product details. If you solved this, please post detailed instructions . Thanks. PS 1.6.14 Default Theme V. Link to comment Share on other sites More sharing options...
eec Posted August 8, 2016 Share Posted August 8, 2016 Thanks to sum4444 I just the recommendation and it works, actually i have simplified it due to the fact that our shop does not use customization or grouping of products hence everything is much simpler. And also I have modified the CSS of the email. Link to comment Share on other sites More sharing options...
xan.s Posted March 7 Share Posted March 7 Hello, I am running into sort of the same Issue, I want to add a list of products, not in any fancy table just a list, to my order_conf email, since i heavily modified it, i just need it to list the ordered products. 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