tdr170 Posted May 7, 2014 Share Posted May 7, 2014 (edited) Hi: Prestashop 1.4.7, mailalerts 2.2 I am trying to get the New order email to show the product prices W/O tax but can not seem to figure it out. I have this working fine for the Order-confirmation mail, and have added a separate tax line to both. This is the code I am working with from mailalerts.php: red=original blue=modified green=added '{total_paid}' => Tools::displayPrice($order->total_paid, $currency), '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), '{total_products}' => Tools::displayPrice($order->getTotalProductsWithOutTaxes(), $currency), '{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency), '{currency}' => $currency->sign, '{message}' => $message ); As you can see I have modified the {total_products} line just at getTotalProducts this does make the Products line below the individual products show total without tax I just can't seem to find where to change the individual products to show without taxes already included in the price. You can aslo see that I have added {total_tax_paid} to this and PaymentModule.php along with the {total_tax_paid} to the emails this works fine. Any help is appreciated. Edited May 7, 2014 by tdr170 (see edit history) Link to comment Share on other sites More sharing options...
tdr170 Posted May 8, 2014 Author Share Posted May 8, 2014 (edited) Ok got it sorted out and was much simpler then expected. Here is what I did so that both the mail sent to customer (order-confirmation) and the mail sent to me (new-order) showed the products without tax included and have a separate tax line. First start with classes/PaymentModule.php in the // Send an e-mail to customer section change 1 line and add 1 line. Change this: '{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false), To this: '{total_products}' => Tools::displayPrice($order->total_products), Add this for the separate tax line: '{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false), Now add the tax line to the order-conf.html and .txt files: I added this just after shipping and before total paid: (html) <tr style="text-align:right;"> <td> </td> <td style="background-color:#EBECEE; padding:0.6em 0.4em;" colspan="3">Sales Tax</td> <td style="background-color:#EBECEE; padding:0.6em 0.4em;">{total_tax_paid}</td> </tr> This to text file: Sales Tax: {total_tax_paid} Now in the MailAlerts module we need to edit the mailalerts.php file: Find this and remove the _wt $unit_price = $product['product_price_wt]; $price = $product['total_price']; Now change 1 line and add 1 line: Change this: '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), To this: '{total_products}' => Tools::displayPrice($order->getTotalProductsWithOutTaxes(), $currency), Add this for separate tax line: '{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $currency, false), Now add the tax line to the new-order.html and .txt files I once again added after shipping before total: <tr style="text-align:right;"> <td colspan="4" style="background-color:#EBECEE; padding:0.6em 0.4em;">Sales Tax</td> <td style="background-color:#EBECEE; padding:0.6em 0.4em;">{total_tax_paid}</td> </tr> and this to txt file. Sales Tax: {total_tax_paid} This is what you should end up with in this case the unit price and product price are shown without tax the total products line is without tax and a separate tax line is shown. I also removed the Gift Wrapping line as we do not offer: Edited May 8, 2014 by tdr170 (see edit history) 3 Link to comment Share on other sites More sharing options...
SaLiC Posted July 28, 2014 Share Posted July 28, 2014 Thanks! Link to comment Share on other sites More sharing options...
Trafiquant Posted November 7, 2014 Share Posted November 7, 2014 You saved my life too! (on PS 1.6) Thank you very much ! Link to comment Share on other sites More sharing options...
JDub1337 Posted March 10, 2015 Share Posted March 10, 2015 Thank you for posting your work! It helped me figure out where the PHP files were that controlled everything. Thanks! JDub Link to comment Share on other sites More sharing options...
galcsaba Posted May 28, 2015 Share Posted May 28, 2015 PrestaShop 1.6 - Mail Alerts Module v3.4 ModificationI need to add the "product image" to the order confirmation mailBy default there's no visible the product images, only shows the Name, Price and Quantity.I want to add the product's small image too to each table row in the notification email template. Any help is appreciated. Sorry for my english Link to comment Share on other sites More sharing options...
YasinTürk Posted May 3, 2016 Share Posted May 3, 2016 I need to add the "product image" to the order confirmation mail ?? 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