Jump to content

[SOLVED] How to add tax value to email template (order_conf.html and .txt)


Recommended Posts

How do I make a swift email code so I can include tax in the order confirmation email? Which file do I need to edit and what code do I need to add to it so it will call the tax amount? I need to know how to make it work in the email template like this:

html e.g.

{total_tax}


I assume {total_tax} will also work in .txt version if it works in html?

Thanks in advance.


P.S. off-topic question, kinda: Will commenting out like

{*blah blah blah*}

work in .txt emails because I would like to comment out the gift-wrapping section? Otherwise, I will just delete it.

  • Like 1

Share this post


Link to post
Share on other sites

In that link you gave me he made some variables which I assume go between line 317 and line 324.

$total_products_notax = $order->total_products;
$total_products = $order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts;
$total_paid_notax = $total_products_notax + $order->total_shipping + $order->total_wrapping - $order->total_discounts;
$total_paid = $total_paid_notax * 1.19;
$total_tax = $total_paid - $total_paid_notax;



Then I make a PHP variable in classes/PaymentModule.php under $data = array (line 324)

'{total_tax}' => Tools::displayPrice($total_tax, $currency, false, false),


Then I add {total_tax} to the .txt and html email templates.

However, how do I make the 1.19 tax rate dynamic? I am also assuming the 1.19 means 1.19%?

Share this post


Link to post
Share on other sites

No, 1.19 means 19% tax is added on top of the total excluding tax. Try changing:

$total_paid = $total_paid_notax * 1.19;
$total_tax = $total_paid - $total_paid_notax;



to:

$total_tax = $order->total_paid - $total_paid_notax;

Share this post


Link to post
Share on other sites

I just realized the Subtotal is adding tax, which I do not want. And tax is also adding shipping.

Here is an example of what I want in the email:

Subtotal - $63.00
Tax - $5.70
Discounts - $0.00
Shipping - $10.75
Total - $79.45

Instead, I am getting:

Subtotal - $68.70
Tax - $16.45
Discounts - $0.00
Shipping - $10.75
Total - $79.45

Subtotal is just the price of the products added together (no discounts or anything else).
Tax is 9.025%.
Discounts is correct at $0.00.
Shipping is correct at $10.75.
And the total is correct at $79.45 (which is what the customer will end up paying when all is said and done).

Here is my code so far for PaymentModule.php:

// Send an e-mail to customer
               if ($id_order_state != _PS_OS_ERROR_ AND $id_order_state != _PS_OS_CANCELED_ AND $customer->id)
               {
                   $invoice = new Address(intval($order->id_address_invoice));
                   $delivery = new Address(intval($order->id_address_delivery));
                   $carrier = new Carrier(intval($order->id_carrier));
                   $delivery_state = $delivery->id_state ? new State(intval($delivery->id_state)) : false;
                   $invoice_state = $invoice->id_state ? new State(intval($invoice->id_state)) : false;
                   $total_paid_notax = $order->total_products; + $order->total_shipping + $order->total_wrapping - $order->total_discounts;
                   $total_tax = $order->total_paid - $total_paid_notax;    

                   $data = array(                    
                   '{firstname}' => $customer->firstname,
                   '{lastname}' => $customer->lastname,
                   '{email}' => $customer->email,
                   '{delivery_company}' => $delivery->company,
                   '{delivery_firstname}' => $delivery->firstname,
                   '{delivery_lastname}' => $delivery->lastname,
                   '{delivery_address1}' => $delivery->address1,
                   '{delivery_address2}' => $delivery->address2,
                   '{delivery_city}' => $delivery->city,
                   '{delivery_postal_code}' => $delivery->postcode,
                   '{delivery_country}' => $delivery->country,
                   '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',
                   '{delivery_phone}' => $delivery->phone,
                   '{delivery_other}' => $delivery->other,
                   '{invoice_company}' => $invoice->company,
                   '{invoice_firstname}' => $invoice->firstname,
                   '{invoice_lastname}' => $invoice->lastname,
                   '{invoice_address2}' => $invoice->address2,
                   '{invoice_address1}' => $invoice->address1,
                   '{invoice_city}' => $invoice->city,
                   '{invoice_postal_code}' => $invoice->postcode,
                   '{invoice_country}' => $invoice->country,
                   '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
                   '{invoice_phone}' => $invoice->phone,
                   '{invoice_other}' => $invoice->other,
                   '{order_name}' => sprintf("#d", intval($order->id)),
                   '{date}' => Tools::displayDate(date('Y-m-d H:i:s'), intval($order->id_lang), 1),
                   '{carrier}' => (strval($carrier->name) != '0' ? $carrier->name : Configuration::get('PS_SHOP_NAME')),
                   '{payment}' => $order->payment,
                   '{products}' => $productsList,
                   '{discounts}' => $discountsList,
                   '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false),
                   '{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false, false),
                   '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false, false),
                   '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false, false),
                   '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false),
                   '{total_tax}' => Tools::displayPrice($total_tax, $currency, false, false));

Share this post


Link to post
Share on other sites

Solved it. Thanks for pointing me in the right direction.

Finished code:

// Send an e-mail to customer
               if ($id_order_state != _PS_OS_ERROR_ AND $id_order_state != _PS_OS_CANCELED_ AND $customer->id)
               {
                   $invoice = new Address(intval($order->id_address_invoice));
                   $delivery = new Address(intval($order->id_address_delivery));
                   $carrier = new Carrier(intval($order->id_carrier));
                   $delivery_state = $delivery->id_state ? new State(intval($delivery->id_state)) : false;
                   $invoice_state = $invoice->id_state ? new State(intval($invoice->id_state)) : false;
                   $total_paid_notax = $order->total_products; + $order->total_shipping + $order->total_wrapping - $order->total_discounts;
                   $total_tax = $order->total_paid - $total_paid_notax - $order->total_shipping;    

                   $data = array(                    
                   '{firstname}' => $customer->firstname,
                   '{lastname}' => $customer->lastname,
                   '{email}' => $customer->email,
                   '{delivery_company}' => $delivery->company,
                   '{delivery_firstname}' => $delivery->firstname,
                   '{delivery_lastname}' => $delivery->lastname,
                   '{delivery_address1}' => $delivery->address1,
                   '{delivery_address2}' => $delivery->address2,
                   '{delivery_city}' => $delivery->city,
                   '{delivery_postal_code}' => $delivery->postcode,
                   '{delivery_country}' => $delivery->country,
                   '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',
                   '{delivery_phone}' => $delivery->phone,
                   '{delivery_other}' => $delivery->other,
                   '{invoice_company}' => $invoice->company,
                   '{invoice_firstname}' => $invoice->firstname,
                   '{invoice_lastname}' => $invoice->lastname,
                   '{invoice_address2}' => $invoice->address2,
                   '{invoice_address1}' => $invoice->address1,
                   '{invoice_city}' => $invoice->city,
                   '{invoice_postal_code}' => $invoice->postcode,
                   '{invoice_country}' => $invoice->country,
                   '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
                   '{invoice_phone}' => $invoice->phone,
                   '{invoice_other}' => $invoice->other,
                   '{order_name}' => sprintf("#d", intval($order->id)),
                   '{date}' => Tools::displayDate(date('Y-m-d H:i:s'), intval($order->id_lang), 1),
                   '{carrier}' => (strval($carrier->name) != '0' ? $carrier->name : Configuration::get('PS_SHOP_NAME')),
                   '{payment}' => $order->payment,
                   '{products}' => $productsList,
                   '{discounts}' => $discountsList,
                   '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false),
                   '{total_products}' => Tools::displayPrice($order->total_paid - $total_tax - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false, false),
                   '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false, false),
                   '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false, false),
                   '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false),
                   '{total_tax}' => Tools::displayPrice($total_tax, $currency, false, false));

  • Like 1

Share this post


Link to post
Share on other sites

  • 5 months later...
  • 6 months later...

What about for version 1.4.4.1, this paymentmodule.php is so different.

I want to just show the product total without tax, not with it, the subtotal without tax on one line and total tax on a seperate line and a third line with the total plus tax, plus shipping and minus discounts. Just on the order confirmation. It already shows correctly in the order

 

Basically just seperate out the tax and have it show on one line.

 

It would be like this

 

Reference Product Unit Price Quantity Total price without tax

12345 Blue Teeshirt $1.50 2 $3.00

 

Total products without tax: $3.00

Total Tax (7%) $00.21

Subtotal: (products + tax) $3.21

Total Discounts: $0.00

Total Gift-wrapping: $0.00

Total Shipping: $1.00

Final Total: $4.21

 

 

 

How is this done?

Share this post


Link to post
Share on other sites

since I am using the new version 1.4.4.1 on my sites now, and the cart shows the total without tax on a seperate line. I should just be able to edit only the order_conf.html file and get it to show the tax and subtotal without tax on seperate lines in the invoice instead of just the product totals with tax included. I have my preferences set to exclude tax on product price.

 

My modules>mail alerts>order_conf.html file code (version 1.4.4.1) was edited with an attempt to do this you will find below.. is this correct? Can you tell me Rocky?

 

<td align="left">
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
  </td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left">Hello <strong style="color:#FF0000;">{firstname} {lastname}</strong>, thank you for shopping with <strong>{shop_name}</strong>.</td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left" style="background-color:#FF0000; color:#FFF; font-size: 12px; font-weight:bold; padding: 0.5em 1em;">Order details</td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left">
Order: <strong><span style="color:#FF0000;">{order_name}</span> placed on {date}</strong>
<br >Payment: <strong>{payment}</strong>
  </td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left">
<table style="width:100%; font-family:Verdana,sans-serif; font-size:11px; color:#374953;">
 <!-- Title -->
 <tr style="background-color:#B9BABE; text-align:center;">
  <th style="width:15%; padding: 0.6em 0;">Reference</th>
  <th style="width:35%; padding: 0.6em 0;">Product</th>
  <th style="width:15%; padding: 0.6em 0;">Unit price</th>
  <th style="width:15%; padding: 0.6em 0;">Quantity</th>
  <th style="width:20%; padding: 0.6em 0;">Total price</th>
 </tr>
 <!-- Products -->
  {products}
  {total_discounts}
 <!-- Footer: prices -->
 <tr style="text-align:right;">
  <td> </td>
  <td colspan="3" style="background-color:#B9BABE; padding:0.6em 0.4em;">Total Products Without Tax</td>
  <td style="background-color:#B9BABE; padding:0.6em 0.4em;">{total_price_without_tax}</td>
 </tr>
				<tr style="text-align:right;">
  <td> </td>
  <td colspan="3" style="background-color:#B9BABE; padding:0.6em 0.4em;">Total Tax</td>
  <td style="background-color:#B9BABE; padding:0.6em 0.4em;">{total_tax}</td>
 </tr>
		  <tr style="text-align:right;">
  <td> </td>
  <td colspan="3" style="background-color:#B9BABE; padding:0.6em 0.4em;">Total Products with Tax </td>
  <td style="background-color:#B9BABE; padding:0.6em 0.4em;">{total_products}</td>
 </tr>
 <tr style="text-align:right;">
  <td> </td>
  <td colspan="3" style="background-color:#EBECEE; padding:0.6em 0.4em;">Total Discounts</td>
  <td style="background-color:#EBECEE; padding:0.6em 0.4em;">{total_discounts}</td>
 </tr>
 <tr style="text-align:right;">
  <td> </td>
  <td colspan="3" style="background-color:#EBECEE; padding:0.6em 0.4em;">Total Gift-wrapping</td>
  <td style="background-color:#EBECEE; padding:0.6em 0.4em;">{total_wrapping}</td>
 </tr>	
 <tr style="text-align:right;">
  <td> </td>
  <td colspan="3" style="background-color:#DDE2E6; padding:0.6em 0.4em;">Total Shipping</td>
  <td style="background-color:#DDE2E6; padding:0.6em 0.4em;">{total_shipping}</td>
 </tr>
 <tr style="text-align:right; font-weight:bold;">
  <td> </td>
  <td colspan="3" style="background-color:#6699FF; padding:0.6em 0.4em;">Final Total Paid</td>
  <td style="background-color:#6699FF; padding:0.6em 0.4em;">{total_paid}</td>
 </tr>
</table>
  </td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left" style="background-color:#FF0000; color:#FFF; font-size: 12px; font-weight:bold; padding: 0.5em 1em;">Shipping</td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left">
Carrier: <strong>{carrier}</strong>
  </td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td>
<table style="width:100%; font-family:Verdana,sans-serif; font-size:11px; color:#374953;">
 <tr style="background-color:#B9BABE; text-transform:uppercase;">
  <th style="text-align:left; padding: 0.3em 1em;">Delivery address</th>
  <th style="text-align:left; padding: 0.3em 1em;">Billing address</th>
 </tr>
 <tr>
  <td style="padding:0.5em 0 0.5em 0.5em; background-color:#EBECEE;">
   {delivery_company}
   <br><span style="color:#FF0000; font-weight:bold;">{delivery_firstname} {delivery_lastname}</span>
   <br>{delivery_address1}
   <br>{delivery_address2}
   <br>{delivery_city}, {delivery_state} {delivery_postal_code}
   <br>{delivery_country}
   <br>{delivery_phone}
   <br>{delivery_other}
  </td>
  <td style="padding:0.5em 0 0.5em 0.5em; background-color:#EBECEE;">
   {invoice_company}
   <br><span style="color:#FF0000; font-weight:bold;">{invoice_firstname} {invoice_lastname}</span>
   <br>{invoice_address1}
   <br>{invoice_address2}
   <br>{invoice_city}, {invoice_state} {invoice_postal_code}
   <br>{invoice_country}
   <br>{invoice_phone}
   <br>{invoice_other}
  </td>
 </tr>
</table>
  </td>
 </tr>
 <tr><td> </td></tr>
 <tr>
  <td align="left">
You can review this order and download your invoice from the <a href="{shop_url}history.php" style="color:#FF0000; font-weight:bold; text-decoration:none;">"Order history"</a> section of your account by clicking <a href="{shop_url}my-account.php" style="color:#FF0000; font-weight:bold; text-decoration:none;">"My account"</a> on our Website.
  </td>

Share this post


Link to post
Share on other sites

  • 4 months later...

The code works perfect, how could i save the total_tax value to Database. I have added total_tax in order,s table and modified some code. but not getting it to work..

 

Any help would be appreciated..

Share this post


Link to post
Share on other sites

  • 1 month later...

How to add separate tax row in customer confirmation email using Prestashop 1.4.7.0

 

in classes/PaymentModule.php find and change to the following:

// Send an e-mail to customer
if ($id_order_state != Configuration::get('PS_OS_ERROR') AND $id_order_state != Configuration::get('PS_OS_CANCELED') AND $customer->id)
{
 $invoice = new Address((int)($order->id_address_invoice));
 $delivery = new Address((int)($order->id_address_delivery));
 $carrier = new Carrier((int)($order->id_carrier), $order->id_lang);
 $delivery_state = $delivery->id_state ? new State((int)($delivery->id_state)) : false;
 $invoice_state = $invoice->id_state ? new State((int)($invoice->id_state)) : false;
 $total_paid_notax = $order->total_products; + $order->total_shipping + $order->total_wrapping - $order->total_discounts;
    $total_tax = $order->total_paid - $total_paid_notax - $order->total_shipping;  

 $data = array(
 '{firstname}' => $customer->firstname,
 '{lastname}' => $customer->lastname,
 '{email}' => $customer->email,
 '{delivery_block_txt}' => $this->_getFormatedAddress($delivery, "\n"),
 '{invoice_block_txt}' => $this->_getFormatedAddress($invoice, "\n"),
 '{delivery_block_html}' => $this->_getFormatedAddress($delivery, "<br />",
  array(
   'firstname' => '<span style="color:#544630; font-weight:bold;">%s</span>',
   'lastname' => '<span style="color:#544630; font-weight:bold;">%s</span>')),
 '{invoice_block_html}' => $this->_getFormatedAddress($invoice, "<br />",
  array(
   'firstname' => '<span style="color:#544630; font-weight:bold;">%s</span>',
   'lastname' => '<span style="color:#544630; font-weight:bold;">%s</span>')),
 '{delivery_company}' => $delivery->company,
 '{delivery_firstname}' => $delivery->firstname,
 '{delivery_lastname}' => $delivery->lastname,
 '{delivery_address1}' => $delivery->address1,
 '{delivery_address2}' => $delivery->address2,
 '{delivery_city}' => $delivery->city,
 '{delivery_postal_code}' => $delivery->postcode,
 '{delivery_country}' => $delivery->country,
 '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',
 '{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
 '{delivery_other}' => $delivery->other,
 '{invoice_company}' => $invoice->company,
 '{invoice_vat_number}' => $invoice->vat_number,
 '{invoice_firstname}' => $invoice->firstname,
 '{invoice_lastname}' => $invoice->lastname,
 '{invoice_address2}' => $invoice->address2,
 '{invoice_address1}' => $invoice->address1,
 '{invoice_city}' => $invoice->city,
 '{invoice_postal_code}' => $invoice->postcode,
 '{invoice_country}' => $invoice->country,
 '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
 '{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile,
 '{invoice_other}' => $invoice->other,
 '{order_name}' => sprintf("#%06d", (int)($order->id)),
 '{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)($order->id_lang), 1),
 '{carrier}' => $carrier->name,
 '{payment}' => Tools::substr($order->payment, 0, 32),
 '{products}' => $productsList,
 '{discounts}' => $discountsList,
 '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false),
 '{total_products}' => Tools::displayPrice($order->total_paid - $total_tax - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false),
 '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false),
 '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false),
 '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false),
 '{total_tax}' => Tools::displayPrice($total_tax, $currency, false));

 

 

 

in /mails/en/order_conf.html find and change to the following:

<tr><td> </td></tr>
<tr>
<td align="left">
<table style="width:100%; font-family:Verdana,sans-serif; font-size:11px; color:#544938;">
<!-- Title -->
<tr style="background-color:#bbbbbb; text-align:center;">
<th style="width:15%; padding: 0.6em 0;">Reference</th>
<th style="width:35%; padding: 0.6em 0;">Product</th>
<th style="width:15%; padding: 0.6em 0;">Unit price</th>
<th style="width:15%; padding: 0.6em 0;">Quantity</th>
<th style="width:20%; padding: 0.6em 0;">Total price</th>
</tr>
<!-- Products -->
{products}
{discounts}
<!-- Footer: prices -->
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#bbbbbb; padding:0.6em 0.4em;">Total Products</td>
<td style="background-color:#bbbbbb; padding:0.6em 0.4em;">{total_products}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#ececec; padding:0.6em 0.4em;">Discounts</td>
<td style="background-color:#ececec; padding:0.6em 0.4em;">{total_discounts}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#ececec; padding:0.6em 0.4em;">Gift Wrapping</td>
<td style="background-color:#ececec; padding:0.6em 0.4em;">{total_wrapping}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#ececec; padding:0.6em 0.4em;">Tax</td>
<td style="background-color:#ececec; padding:0.6em 0.4em;">{total_tax}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#e1e1e1; padding:0.6em 0.4em;">Shipping</td>
<td style="background-color:#e1e1e1; padding:0.6em 0.4em;">{total_shipping}</td>
</tr>
<tr style="text-align:right; font-weight:bold;">
<td> </td>
<td colspan="3" style="background-color:#bdbdbd; padding:0.6em 0.4em;">Total paid</td>
<td style="background-color:#bdbdbd; padding:0.6em 0.4em;">{total_paid}</td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>

 

Hope this helps

  • Like 3

Share this post


Link to post
Share on other sites

  • 1 month later...

I'm also trying to get lines with "total without tax" and "total tax" in my order confirmation mail in PS 1.4.7.3

But I see 2 issues with the last proposed code change in PaymentModule.php.

First, there's a semicolon that shouldn't be there in this added line:

$total_paid_notax = $order->total_products; + $order->total_shipping + $order->total_wrapping - $order->total_discounts;

This should be like this:

$total_paid_notax = $order->total_products + $order->total_shipping + $order->total_wrapping - $order->total_discounts;

 

Second, this calculation isn't done correctly since the total_shipping part of this line still includes tax. Might be true for wrapping en discounts as well but haven't checked.

Share this post


Link to post
Share on other sites

  • 2 months later...

Has anyone found a working solution to this issue.

 

This seems to be a fundamental requirement of the software, why would you not want to include tax in the order confirmation email?

 

Can anyone confirm whether the above code changes work?

 

Thanks

 

Lee

Share this post


Link to post
Share on other sites

  • 3 months later...

How to add separate tax row in customer confirmation email using Prestashop 1.4.7.0

 

in classes/PaymentModule.php find and change to the following:

// Send an e-mail to customer
if ($id_order_state != Configuration::get('PS_OS_ERROR') AND $id_order_state != Configuration::get('PS_OS_CANCELED') AND $customer->id)
{
 $invoice = new Address((int)($order->id_address_invoice));
 $delivery = new Address((int)($order->id_address_delivery));
 $carrier = new Carrier((int)($order->id_carrier), $order->id_lang);
 $delivery_state = $delivery->id_state ? new State((int)($delivery->id_state)) : false;
 $invoice_state = $invoice->id_state ? new State((int)($invoice->id_state)) : false;
 $total_paid_notax = $order->total_products; + $order->total_shipping + $order->total_wrapping - $order->total_discounts;
 $total_tax = $order->total_paid - $total_paid_notax - $order->total_shipping;  

 $data = array(
 '{firstname}' => $customer->firstname,
 '{lastname}' => $customer->lastname,
 '{email}' => $customer->email,
 '{delivery_block_txt}' => $this->_getFormatedAddress($delivery, "\n"),
 '{invoice_block_txt}' => $this->_getFormatedAddress($invoice, "\n"),
 '{delivery_block_html}' => $this->_getFormatedAddress($delivery, "<br />",
  array(
   'firstname' => '<span style="color:#544630; font-weight:bold;">%s</span>',
   'lastname' => '<span style="color:#544630; font-weight:bold;">%s</span>')),
 '{invoice_block_html}' => $this->_getFormatedAddress($invoice, "<br />",
  array(
   'firstname' => '<span style="color:#544630; font-weight:bold;">%s</span>',
   'lastname' => '<span style="color:#544630; font-weight:bold;">%s</span>')),
 '{delivery_company}' => $delivery->company,
 '{delivery_firstname}' => $delivery->firstname,
 '{delivery_lastname}' => $delivery->lastname,
 '{delivery_address1}' => $delivery->address1,
 '{delivery_address2}' => $delivery->address2,
 '{delivery_city}' => $delivery->city,
 '{delivery_postal_code}' => $delivery->postcode,
 '{delivery_country}' => $delivery->country,
 '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',
 '{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
 '{delivery_other}' => $delivery->other,
 '{invoice_company}' => $invoice->company,
 '{invoice_vat_number}' => $invoice->vat_number,
 '{invoice_firstname}' => $invoice->firstname,
 '{invoice_lastname}' => $invoice->lastname,
 '{invoice_address2}' => $invoice->address2,
 '{invoice_address1}' => $invoice->address1,
 '{invoice_city}' => $invoice->city,
 '{invoice_postal_code}' => $invoice->postcode,
 '{invoice_country}' => $invoice->country,
 '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
 '{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile,
 '{invoice_other}' => $invoice->other,
 '{order_name}' => sprintf("#%06d", (int)($order->id)),
 '{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)($order->id_lang), 1),
 '{carrier}' => $carrier->name,
 '{payment}' => Tools::substr($order->payment, 0, 32),
 '{products}' => $productsList,
 '{discounts}' => $discountsList,
 '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false),
 '{total_products}' => Tools::displayPrice($order->total_paid - $total_tax - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false),
 '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false),
 '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false),
 '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false),
 '{total_tax}' => Tools::displayPrice($total_tax, $currency, false));

 

 

 

in /mails/en/order_conf.html find and change to the following:

<tr><td> </td></tr>
<tr>
<td align="left">
<table style="width:100%; font-family:Verdana,sans-serif; font-size:11px; color:#544938;">
<!-- Title -->
<tr style="background-color:#bbbbbb; text-align:center;">
<th style="width:15%; padding: 0.6em 0;">Reference</th>
<th style="width:35%; padding: 0.6em 0;">Product</th>
<th style="width:15%; padding: 0.6em 0;">Unit price</th>
<th style="width:15%; padding: 0.6em 0;">Quantity</th>
<th style="width:20%; padding: 0.6em 0;">Total price</th>
</tr>
<!-- Products -->
{products}
{discounts}
<!-- Footer: prices -->
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#bbbbbb; padding:0.6em 0.4em;">Total Products</td>
<td style="background-color:#bbbbbb; padding:0.6em 0.4em;">{total_products}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#ececec; padding:0.6em 0.4em;">Discounts</td>
<td style="background-color:#ececec; padding:0.6em 0.4em;">{total_discounts}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#ececec; padding:0.6em 0.4em;">Gift Wrapping</td>
<td style="background-color:#ececec; padding:0.6em 0.4em;">{total_wrapping}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#ececec; padding:0.6em 0.4em;">Tax</td>
<td style="background-color:#ececec; padding:0.6em 0.4em;">{total_tax}</td>
</tr>
<tr style="text-align:right;">
<td> </td>
<td colspan="3" style="background-color:#e1e1e1; padding:0.6em 0.4em;">Shipping</td>
<td style="background-color:#e1e1e1; padding:0.6em 0.4em;">{total_shipping}</td>
</tr>
<tr style="text-align:right; font-weight:bold;">
<td> </td>
<td colspan="3" style="background-color:#bdbdbd; padding:0.6em 0.4em;">Total paid</td>
<td style="background-color:#bdbdbd; padding:0.6em 0.4em;">{total_paid}</td>
</tr>
</table>
</td>
</tr>
<tr><td> </td></tr>

 

Hope this helps

 

Thank you so much for your fix! It worked wonderfully in 1.4.5.1

 

It works fine in 1.5.2 as well :)

 

Would be nice if prestashop includes this in future releases! It makes total sense to show the tax amount on the email.

 

Thank you again!!

Edited by Arkadia (see edit history)

Share this post


Link to post
Share on other sites

  • 7 months later...

Hello

 

I raise the topics in the sense that I want to activate for PrestaShop 1.5.4.1, how?

 

Because I seek in the French forum is English view is I do not think for version 1.5 see.

 

thank you

 

good day

 

Mz

 

PS :

 

I'm talking about, display the price excluding tax bill that the client receives by email

Edited by MisterM7543 (see edit history)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More