Change way Tax percent is shown on invoice

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Change way Tax percent is shown on invoice

Post by 14Steve14 »

I am wanting to change the way the VAT tax percentage is shown in the admin/invoice.php file.

It is this bit of code here

Code: Select all

echo '<td class="text-right">' . tep_display_tax_value($product['tax']) . '%</td>';
Currently the percentage shows as 20.00%, and I would lie it to show as 20%, so without the decimal places. I only need it changed in this one file to make a custom invoice look a little better.


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Change way Tax percent is shown on invoice

Post by ecartz »

Code: Select all

echo '<td class="text-right">' . Tax::format($product['tax'], 0) . '%</td>';
I think it should work the same way with tep_display_tax_value.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Change way Tax percent is shown on invoice

Post by heatherbell »

14Steve14 wrote: Fri Apr 01, 2022 2:46 pm Currently the percentage shows as 20.00%, and I would lie it to show as 20%, so without the decimal places. I only need it changed in this one file to make a custom invoice look a little better.
I guess you do not charge any tax rates that have a fraction? That is, all your tax rates are whole numbers?
Currently, they all are in U.K. (20, 5 and 0)
In which case, why would the decimal places be needed anywhere?
Simplest is admin>Configuration>My Store>Tax Decimal Places - set to 0
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Change way Tax percent is shown on invoice

Post by 14Steve14 »

heatherbell wrote: Fri Apr 01, 2022 3:07 pm
14Steve14 wrote: Fri Apr 01, 2022 2:46 pm Currently the percentage shows as 20.00%, and I would lie it to show as 20%, so without the decimal places. I only need it changed in this one file to make a custom invoice look a little better.
I guess you do not charge any tax rates that have a fraction? That is, all your tax rates are whole numbers?
Currently, they all are in U.K. (20, 5 and 0)
In which case, why would the decimal places be needed anywhere?
Simplest is admin>Configuration>My Store>Tax Decimal Places - set to 0
I did think about doing that but wondered if it would affect anything else. Just wasnt confident to give it a try. Seems to work anyway. Thanks.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply