Tax line not showing in order confirmation email?

In this board, we will periodically list various tips and tricks we find that may help in your use of PrestaShop. This will also include tips on the use of Agile modules. If you have a great tip, fix, or workaround for a PrestaShop feature, feel free to post it here...

Tax line not showing in order confirmation email?

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

Re: cheap tax preparation near me

Postby office-ser62_15971 » Tue May 19, 2020 10:05 am

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!
office-ser62_15971
 
Posts: 6
Joined: Tue May 19, 2020 10:03 am
Location: 6530 Trask Terrace Alexandria, VA 22315


Return to Tips and Tricks for PrestaShop and Agile Modules

Who is online

Users browsing this forum: No registered users and 1 guest