Page 1 of 1

Tax line not showing in order confirmation email?

PostPosted: Tue Apr 09, 2013 4:06 am
by Terry
If your customers are getting an order confirmation email that doesn't have a tax line, but you want the tax to be displayed in the email, try this fix in your PrestaShop 1.5x store.

First, edit the file: /classes/PaymentModule.php

Around line 558, find the line:

$invoice_state = $invoice->id_state ? new State($invoice->id_state) : false;

Immediately following this line, insert the following two lines:

$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;


Then, just after line 600, find the following lines:

'{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false));


Change the last line above to:

'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false),

And add the following line directly below the above line:

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

Save the file.
-----------------

Next, edit the file: /mails/en/order_conf.html

About line 55, find the following code:

<tr style="text-align: right;">
<td>&nbsp;</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;" colspan="3">Gift-wrapping</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;">{total_wrapping}</td>
</tr>


And directly below that insert the following code:

<tr style="text-align: right;">
<td>&nbsp;</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;" colspan="3">Tax</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;">{total_tax}</td>
</tr>


Save the file.

--------------------

In most cases, this should show a separate tax line in the customer's order confirmation email. Hope this helps...

Re: cheap tax preparation near me

PostPosted: Tue May 19, 2020 10:05 am
by office-ser62_15971
Postby Terry ยป Tue Apr 09, 2013 4:06 am
If your customers are getting an order confirmation email that doesn't have a tax line, but you want the tax to be displayed in the email, try this fix in your PrestaShop 1.5x store.

First, edit the file: /classes/PaymentModule.php

Around line 558, find the line:

$invoice_state = $invoice->id_state ? new State($invoice->id_state) : false;

Immediately following this line, insert the following two lines:

$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;

Then, just after line 600, find the following lines:

'{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false));

Change the last line above to:

'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false),

And add the following line directly below the above line:

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

Save the file.
-----------------

Next, edit the file: /mails/en/order_conf.html

About line 55, find the following code:

<tr style="text-align: right;">
<td>&nbsp;</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;" colspan="3">Gift-wrapping</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;">{total_wrapping}</td>
</tr>

And directly below that insert the following code:

<tr style="text-align: right;">
<td>&nbsp;</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;" colspan="3">Tax</td>
<td style="background-color: #ebecee; padding: 0.6em 0.4em;">{total_tax}</td>
</tr>

Save the file.

--------------------

In most cases, this should show a separate tax line in the customer's order confirmation email. Hope this helps...
Like us on FaceBook ~ Follow us on Twitter ~ Tutorial videos on YouTube

Terry

Posts: 125
Joined: Mon Oct 22, 2012 12:49 am

Top



Yes, you submitted the information correctly. Thank!