close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Adding VAT to the UPS Shipping Charge - Not calculating correctly?

Thread began 9/01/2015 6:30 am by Nathon Jones Web Design | Last modified 9/02/2015 1:57 pm by Ray Borduin | 405 views | 3 replies |

Nathon Jones Web Design

Adding VAT to the UPS Shipping Charge - Not calculating correctly?

Long winded explanation but I think it's required here. I need to charge VAT only on products within a certain category. So, I created the following calculation and named it "VAT":
([Category]==1)?[TotalPrice] * 0.2:0

Basically if a product is from Category "1" then 20% is added to the total price for that item.

Then, in my Tax rules, I created the following rule and named it "VAT on Bottles":
Number of items with Category of 1 > 0

Based on column subtotal
Subtotal of column VAT plus 0

This works perfectly.

However, I also need to add 20% VAT to the UPS shipping charge. I initially opted for the "include shipping in cart subtotal when calculating sales tax" option in the Shipping rules tab however I quickly realised that because my initial setup is a calculation I can't select "Based on the cart's taxable total" in the "VAT on Bottles" Tax rule.

So, I created another Tax rule and named it "VAT on Shipping" as follows:

UPS shipping quote > 0

Based on UPS shipping quote value
UPS shipping quote times 0.2

Initially I thought this was working but after looking closely at the figures, I realised that it's not calculating the VAT correctly.

For example, if we have a product in the cart valued at £80.00 then it applies a VAT charge of £16.00 (20%). Perfect.

However, when we add the UPS Shipping to that order, which in this instance is £14.01, it charges an additional £2.30 in VAT making a total VAT charge of £18.30.

20% of £14.01 is £2.802 so it's close to £0.50 short!

I attach my cart files for inspection but let me know what else I need to send.

You can also test this at:

Thank you.

EDIT: Urggh...the UPS charge already includes VAT so we need to strip out 20% from that and display the fee before VAT, moving the VAT amount into, somehow, the VAT tax charge area.

Sign in to reply to this post

Ray BorduinWebAssist

Yes, it includes VAT, so you probably need to do the opposite to remove the VAT.

Sign in to reply to this post

Nathon Jones Web Design

Ray, I've added a flat rate of £2.50 to the UPS Shipping charge to cover packaging as you'd advised in this post:

Originally Said By: Ray Borduin
  You can delete the charge and add the flat rate to the existing UPS shipping charge by editing it in the eCart object.  

I've realised that the 20% VAT being calculated isn't taking into account this £2.50 but is, instead, only taking the UPS value - that's why it's £0.50 short.

How do I correct the calculation to also include the £2.50 flat rate and also, how to I remove the VAT? If I remove the VAT at the moment I'm sure that it will only be doing the calculation on the UPS shipping amount and not the UPS Shipping + Flat Rate £2.50.

Hope that makes sense.
Thank you.


Originally Said By: Ray Borduin
  Yes, it includes VAT, so you probably need to do the opposite to remove the VAT.  

Yes, but I still need to charge the VAT, I just need it to appear in the Tax list and not be included in the shipping charge.

Sign in to reply to this post

Ray BorduinWebAssist

You can do that with math on the page.

Shipping: <?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetShipping()/1.2); ?>
Tax: <?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetTax() + ((0.2*$eCart1->GetShipping())/1.2)); ?>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...