diu1so Posted May 20, 2010 Share Posted May 20, 2010 I want to add more stuff to the order confirmation email (new order email), so I dont need to acces every time an order comes the back-end of the webshop.So, I would like to add some data like: - mobile phone number - the group in which the user is - other informations provided under by the userdoes anyone know a solution to add this datas in that email?Thank you very much. Link to comment Share on other sites More sharing options...
rocky Posted May 20, 2010 Share Posted May 20, 2010 To add the mobile phone numbers to the "New order" email, you'll need to modify the "// Filling-in vars for email" section on line 130 of modules/mailalerts/mailalerts.php and add the following to the $templateVars array: '{delivery_mobile}' => $delivery->phone_mobile, '{invoice_mobile}' => $invoice->phone_mobile, To put the customer group in the email is not so easy, since customers can be in multiple groups and you can't use foreach loops in the email templates. The best you can do is to get the last customer group. For example: $groups = $customer->getGroups(); then add the following to the $templateVars array: '{customer_group}' => $groups[sizeof($groups) - 1], 1 Link to comment Share on other sites More sharing options...
diu1so Posted May 20, 2010 Author Share Posted May 20, 2010 Thank you very much rocky.Since I have only two groups, for now it's good this solution too.If you have more ideas of adding data in the new order email you could (please) add them in this topic to have them together. Link to comment Share on other sites More sharing options...
rocky Posted May 20, 2010 Share Posted May 20, 2010 Actually, now that I think about it, you could get all the customer groups by using the following code: $groups = $customer->getGroups(); $customer_groups = ''; foreach ($groups as $group) $customer_groups .= ($customer_groups != '' ? ', ' : '') . $group; then: '{customer_groups}' => $customer_groups, 1 Link to comment Share on other sites More sharing options...
netman Posted September 12, 2010 Share Posted September 12, 2010 Rocky,I would like to add EAN13, unit price (excl tax), tax, total price (unit price + tax) as well as total tax, total price (excl tax) and Grand Total (Total price + total tax). How can I achieve this?I am working on a wholesale website and all detailed tax information is required in the new order email.Thanks Link to comment Share on other sites More sharing options...
rocky Posted September 13, 2010 Share Posted September 13, 2010 It's easy to do. You'll need to modify a lot of code.For example, to add the EAN13, you will need to edit classes/PaymentModule.php and change lines 225 and 236 (in PrestaShop v1.3.1) from: '.$product['reference'].' to: '.$product['reference'].' '.$product['ean13].' then change lines 35-39 of order_conf.html in your mails directory from: Reference Product Unit price Quantity Total price to: Reference EAN13 Product Unit price Quantity Total price For the total, you will need to add a new entry in the $data array on line 308 like the following: '{grand_total}' => $order->total_paid_real, Then add {grand_total} to order_conf.html and order_conf.txt where you want it to be displayed.Hopefully, this will guide you in the right direction. 1 Link to comment Share on other sites More sharing options...
netman Posted September 13, 2010 Share Posted September 13, 2010 Hi Rocky,Thanks for you quick reply. I have made the changes. EAN13 title is inserted but the actual product ean13 is not inserted. I assume the barcode should be inserted by this code in PaymentModule.php '.$product['ean13'].' Do you know what else I should do to diaply the barcodes?Thanks Link to comment Share on other sites More sharing options...
netman Posted September 13, 2010 Share Posted September 13, 2010 Rocky,I have figured out how to insert ean13 by modifying mailalerts.php. I am mainly concerned with new order alert. Thank you for your help on this.I have another question. In the new order email or invoice I want to display both unit price and total prices without tax, and display total tax separately. How can I achieve this? What I want to display:EAN13 Product Name Unit Price (excl tax) Quantity Total Price (excl tax) Net Total Total Tax Grand Total Link to comment Share on other sites More sharing options...
rocky Posted September 14, 2010 Share Posted September 14, 2010 I'm not sure why it isn't working. It is the following on line 228 that is part of the query that gets the EAN13: IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13, pai.`id_image` AS \'pai_id_image\' I suggest that you add the following on line 255 after the query: echo $sql; This will display the query that is being executed. Copy it and try running it using phpMyAdmin to see whether the EAN13 is included in the results. Link to comment Share on other sites More sharing options...
texscalper Posted October 19, 2010 Share Posted October 19, 2010 Hello , I used EAN13 too in my new order email and changed the code some time ago: the updates to the code are similair to what Rocky wrote above. But I went over too : I managed to add a new flag in order to be able to send a different notification email to the depot (that will pick the products and then ship them).Now I want to add more fields to this new email (ean13 has been already added): I want to add a field for the size of the product (or box).I was thinking of using a feature field to store the SIZE of the product/box.Any suggestion?Is using a feature is ok, then how can I retrieve the value in the mailalert.php ? Is there a function ? Or do I have to modify the query ?Thanks Link to comment Share on other sites More sharing options...
lozaria Posted September 15, 2012 Share Posted September 15, 2012 This is how I added mobile phones to new order mail on PS 1.4.7.3 Edit: /modules/mailalerts/mails / your language / new_order.html Added this after {delivery_block_html}: {delivery_phone_mobile} {delivery_phone} Added this after {invoice_block_html}: {invoice_phone_mobile} {invoice_phone} Edit /modules/mailalerts/mailalerts.php Added this after '{delivery_phone}' => $delivery->phone, : '{delivery_phone_mobile}' => $delivery->phone_mobile, And this after '{invoice_phone}' => $invoice->phone, : '{invoice_phone_mobile}' => $invoice->phone_mobile, 1 Link to comment Share on other sites More sharing options...
DylzEn Posted October 17, 2012 Share Posted October 17, 2012 Hello guys. Thank you for sharing your solutions. I'd like to add the description and the short description next to the product name in the New Order email generated by mailalerts. I have several products with the same name so I can't distuinguish them when I receive an order. Can anyone help with this? I'd really appreciate it. Thank you for your time. Best regards, Dylan Link to comment Share on other sites More sharing options...
infinityl Posted February 5, 2013 Share Posted February 5, 2013 It's easy to do. You'll need to modify a lot of code. For example, to add the EAN13, you will need to edit classes/PaymentModule.php and change lines 225 and 236 (in PrestaShop v1.3.1) from: '.$product['reference'].' to: '.$product['reference'].' '.$product['ean13].' then change lines 35-39 of order_conf.html in your mails directory from: Reference Product Unit price Quantity Total price to: Reference EAN13 Product Unit price Quantity Total price For the total, you will need to add a new entry in the $data array on line 308 like the following: '{grand_total}' => $order->total_paid_real, Then add {grand_total} to order_conf.html and order_conf.txt where you want it to be displayed. Hopefully, this will guide you in the right direction. Ey rocky this post is a lot of help!! But is a little older... in 1.5.3.1 in classes/PaymentModule.php there is no '.$product['reference'].' in that lines... i think is in the 381... between <td..."??? And the important question... i have a "feature" in each product named acslink... how i send that data from paymentmodule to paymentconfirmation email??? A LOT of thanks! By the other hand... in classes/PaymentModule.php i see styles and html coding... ¿is that correct MCV? lines 380- 386... '<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['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>'; Link to comment Share on other sites More sharing options...
patrmich Posted May 17, 2013 Share Posted May 17, 2013 Hi, I am using Prestashop 1.4.7.0. Would it be possible to display the EAN13 product code on the order confirmation received by the merchant ? Thnak you in advance for any help in this matter. Patrick Link to comment Share on other sites More sharing options...
veravalonline Posted August 13, 2013 Share Posted August 13, 2013 Just add {delivery_phone} anywhere you want to put to show the contact details on the new_order.html into the mailalerrts modules and mails Thanks Link to comment Share on other sites More sharing options...
Sanjay.zala Posted August 14, 2013 Share Posted August 14, 2013 (edited) hi all, I have same issue, i want to change order email content from my custome module. Please let me know. Edited August 14, 2013 by Sanjay.zala (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 14, 2013 Share Posted August 14, 2013 ąnd you're using the same ps version ? Link to comment Share on other sites More sharing options...
Sanjay.zala Posted August 14, 2013 Share Posted August 14, 2013 (edited) i am using ps version 1.4.7 and i have to change content of order mail from my module. Edited August 14, 2013 by Sanjay.zala (see edit history) Link to comment Share on other sites More sharing options...
Pman 77 Posted September 18, 2013 Share Posted September 18, 2013 Hi Guys, Rocky you seem to be a legend on all things mail!! Im using version 1.5.4.1 and i need to add messages {messages} in to the order_conf.txt file as i print the orders directly in the restaurant as the orders come in, they have no access to BO PS. To check for messages. Any help on this would be awesome. Regards Patrick Link to comment Share on other sites More sharing options...
gigant09 Posted October 6, 2013 Share Posted October 6, 2013 Is there any solution to add the EAN13 Number into new_order mailalert for Prestashop 1.5.x? Thank you! Link to comment Share on other sites More sharing options...
julian walker Posted October 11, 2013 Share Posted October 11, 2013 How do you add a VAT field to new_order.html ( new order mail to shop)? I tried '{total_tax}' => Tools::displayPrice($order->total_tax, $currency), in mailalerts.php it didnt work I managed to get the Net Amount in by replacing '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), to '{total_products}' => Tools::displayPrice($order->getTotalProductsWithoutTaxes(), $currency), but still cant get rid of the Total Price( with VAT added ) at the top Please... Cheers Julian Link to comment Share on other sites More sharing options...
creacion Posted November 25, 2013 Share Posted November 25, 2013 I also need to include {total_tax} in new_order.html any suggestion? Link to comment Share on other sites More sharing options...
nspinheiro Posted December 26, 2013 Share Posted December 26, 2013 To put the customer group in the email is not so easy, since customers can be in multiple groups and you can't use foreach loops in the email templates. The best you can do is to get the last customer group. For example: $groups = $customer->getGroups(); Sorry to retrieve such old post, but where do i add this? Link to comment Share on other sites More sharing options...
ietax Posted February 26, 2014 Share Posted February 26, 2014 I searched a lot for my request... I have PS 1.5.62 I'd like to add images on my mail (order confirm). It is possible? Thanks Link to comment Share on other sites More sharing options...
shinnokdrako Posted March 5, 2014 Share Posted March 5, 2014 Hello all, i'd need some extra infos from the order confirmation mail: the Paypal status. How can i put it in the code? And is it possible? I don't know if the status of paypal changes AFTER getting the confirmation mail or if the mail is sent after the customer pays with Paypal. How can i do it? Thanks Link to comment Share on other sites More sharing options...
Seos Posted April 22, 2015 Share Posted April 22, 2015 Actually, now that I think about it, you could get all the customer groups by using the following code: $groups = $customer->getGroups();$customer_groups = '';foreach ($groups as $group) $customer_groups .= ($customer_groups != '' ? ', ' : '') . $group; then: '{customer_groups}' => $customer_groups, Not work in Prestashop 1.6.0.9 Any idea? Thanks Link to comment Share on other sites More sharing options...
Seos Posted April 22, 2015 Share Posted April 22, 2015 The solutionhttps://www.prestashop.com/forums/topic/438473-enviar-nombre-del-grupo-en-correo-prestashop-1609/?do=findComment&comment=2036331Regards Link to comment Share on other sites More sharing options...
wiseprt Posted June 29, 2015 Share Posted June 29, 2015 (edited) Hello, I want to get product image next to product title (or before) in the order confirmation email template. Any ideas? Best Regards Edited June 29, 2015 by wiseprt (see edit history) Link to comment Share on other sites More sharing options...
wiseprt Posted July 1, 2015 Share Posted July 1, 2015 Anyone? Hello, I want to get product image next to product title (or before) in the order confirmation email template. Any ideas? Best Regards Link to comment Share on other sites More sharing options...
Vali16 Posted March 18, 2016 Share Posted March 18, 2016 Hello guys. Thank you for sharing your solutions. I'd like to add the description and the short description next to the product name in the New Order email generated by mailalerts. I have several products with the same name so I can't distuinguish them when I receive an order. Can anyone help with this? I'd really appreciate it. Thank you for your time. Best regards, Dylan Hi, Didi you find a clean solution for adding description and the short description next to the product name in email? I am PS 1.6.14, I could not find a clear way to insert additional product information in status emails. V. Link to comment Share on other sites More sharing options...
Arpels Posted July 9, 2016 Share Posted July 9, 2016 Hi, Didi you find a clean solution for adding description and the short description next to the product name in email? I am PS 1.6.14, I could not find a clear way to insert additional product information in status emails. V. Hello, I'm also interested in the solution to add additionnal information to mails, which seems to be sent by the Mail Alert module, for prestashop 1.6. K Link to comment Share on other sites More sharing options...
Shara_AC Posted August 19, 2019 Share Posted August 19, 2019 (edited) hello guys. please help me because i have new problem This happened when i am resend email The email sent contains {bankwire_number} because this is custom module anyone please help me Edited August 19, 2019 by yahyaefendy (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