Mitchmaster Posted April 7, 2013 Share Posted April 7, 2013 This should be easy, but it doesn't work! To resend an order confirmation email, you should be able to create a new order status and choose order_conf as the email template. Switching the status of an order to this new status does indeed send out the order confirmation email, but most of the fields are blank! Only the customer name and the total paid come through. I really need to use this feature! Can anybody tell me what I'm doing wrong, or is this a bug? Thanks! Link to comment Share on other sites More sharing options...
S7 Media Ltd Posted May 28, 2013 Share Posted May 28, 2013 Hi, I need something similar too. Thanks Link to comment Share on other sites More sharing options...
gulfsupplements Posted November 10, 2013 Share Posted November 10, 2013 Hello, I also badly need this, please help! Thanks Link to comment Share on other sites More sharing options...
Mitchmaster Posted November 11, 2013 Author Share Posted November 11, 2013 I did find a solution to this problem. It required some changes to the OrderHistory.php module in the classes directory. Be warned that this is a root module, which means that if you upgrade to another version these changes will likely disappear. The changes start at line 151: $sql='SELECT `'._DB_PREFIX_.'orders`.`id_order`,`total_discounts`,`total_shipping`,`invoice_date`,`payment`, `tax_name`, `tax_rate`, `amount` FROM `'._DB_PREFIX_.'orders`, `'._DB_PREFIX_.'order_tax` WHERE `'._DB_PREFIX_.'orders`.`id_order` = '.(int)($this->id_order). ' AND `'._DB_PREFIX_.'orders`.`id_order` = `'._DB_PREFIX_.'order_tax`.`id_order`'; $result2 = Db::getInstance()->getRow($sql); if (isset($result2['id_order'])) { $discount=$result2['total_discounts']; $shipping=$result2['total_shipping']; $date=explode(" ",$result2['invoice_date']); $date=$date[0]; $date=explode("-",$date); $date=$date[1]."/".$date[2]."/".$date[0]; $paid=$result2['payment']; $taxLabel=$result2['tax_name']; $taxAmount=$result2['amount']; if ($paid=="authorizeaim") {$paid="Credit Card";} } $order = new Order((int)$this->id_order); $order->taxAmount=$taxAmount; $products = $order->getProductsDetail(); $total_products = 0; foreach ($products as $key => $product) { $name=$product['product_name']; $price=$product['product_price']; $total_products+=$price; $qty=$product['product_quantity']; $productsList .= '<tr style="background-color: '.'#DDE2E6'.';"> <td style="padding: 0.6em 0.4em;"> </td> <td style="padding: 0.6em 0.4em;"><strong>'.$name.'</strong></td> <td style="padding: 0.6em 0.4em; text-align: right;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price, 2, false).'</td> <td style="padding: 0.6em 0.4em; text-align: center;">'.$qty.'</td> <td style="padding: 0.6em 0.4em; text-align: right;">'.Tools::displayPrice($qty * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price), 2, false).'</td> </tr>'; } $topic = $result['osname']; $data = array('{products}' => $productsList, '{payment}' => $paid, '{date}' => $date, '{total_shipping}' => $shipping, '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{total_tax}' => $taxAmount, '{tax_label}' => $taxLabel); if ($templateVars) $data = array_merge($data, $templateVars); //$order = new Order((int)$this->id_order); $data['{total_paid}'] = Tools::displayPrice((float)$order->total_paid, new Currency((int)$order->id_currency), false); $data['{total_products}'] = Tools::displayPrice((float)$order->total_products, new Currency((int)$order->id_currency), false); $data['{total_discounts}'] = Tools::displayPrice((float)$order->total_discounts, new Currency((int)$order->id_currency), false); $data['{order_name}'] = sprintf("#%06d", (int)$order->id); $data['{total_tax}'] = Tools::displayPrice((float)$taxAmount, new Currency((int)$order->id_currency), false); Only 4 or 5 lines in there are changed, but I included the whole block for easy insertion. This modification will not only allow you to generate an order confirmation at any time, it also will allow you to display the tax amount by itself in the email. There is a field for gift wrapping which I deleted since I don't do that on my store, but this code should give you the basics on how to fix that field as well. Good luck! Link to comment Share on other sites More sharing options...
gulfsupplements Posted November 12, 2013 Share Posted November 12, 2013 Which version of Prestashop are we talking here? I am using 1.3.2 and cannot find this in OrderHistory.php Link to comment Share on other sites More sharing options...
Mitchmaster Posted November 12, 2013 Author Share Posted November 12, 2013 Sorry, I meant to include the version number in my previous post. I'm on 1.4.7.3. Link to comment Share on other sites More sharing options...
zeki893 Posted August 7, 2014 Share Posted August 7, 2014 Any way to do this in 1.6? Link to comment Share on other sites More sharing options...
zeki893 Posted August 10, 2014 Share Posted August 10, 2014 ya i've been trying to figure this out for 1.6 as well. bump. Link to comment Share on other sites More sharing options...
ps20 Posted December 22, 2014 Share Posted December 22, 2014 (edited) Resend order confirmation The soluton is here Thanks Edited December 22, 2014 by ps20 (see edit history) Link to comment Share on other sites More sharing options...
zeki893 Posted December 22, 2014 Share Posted December 22, 2014 cool i'll check it out Link to comment Share on other sites More sharing options...
kapselj Posted January 7, 2016 Share Posted January 7, 2016 Hi ps20, Link is not working. Could you update it please? Link to comment Share on other sites More sharing options...
Recommended Posts