Jump to content

Tax is incorect


Recommended Posts

CC 5.2.13 (just upgraded from 5.2.12)


I am running a sale, and it may be that Coupon codes are messing up tax calculation (6% PA tax)


Here is a sale from 9/20/2014 (running 5.2.12) and calculated tax fine
note: 6% tax on items and shipping is needed.


2 x 20102M49 ($10.50)

Total Discount :$0.00
PA tax:$1.56



Here are two orders where tax was incorrect, where the customer used a coupon code (today 9/27/2014)


1 x 1867FP14 ($10.99) $10.99

1 x 1867FP2 ($10.99)
1 x 1867FG23 ($10.99)$10.99
1 x 7357L ($9.29)$9.29
Total Discount :$5.00
PA tax:$1.28


1 x QP6 ($10.00)

1 x 1867R12 ($8.79)$8.79
1 x TJLgKit ($29.95)$29.95
Total Discount :$5.00
PA tax:$1.47


Link to comment
Share on other sites

  • 1 month later...

I have exactly the same issue with a store in California.  Tax rate is 8.25% and all is fine if no coupon is used.


As soon as a coupon is used, the tax is wrong. 


Does anyone have an explanation for this?


CC 5.2.14

Link to comment
Share on other sites

I have discovered something interesting - with the coupon, the tax rate goes consistently to exactly 4%.

There is no tax class / rule in this store with anything set at 4%.  There is only the standard tax of 8.25% and a class that is tax exempt (which is assigned to no products).


It doesn't solve anything but maybe it is a clue?



I have done a bunch of things to see if I can follow this to the issue.


I am not sure, but it appears there is a logic error in the get() function in the classes/cart.class.php file.

I have been studying it but am not familiar enough with the way this is structured to see it easily.

I also have two large programming projects going right now and don't have the time to devote to solving the code problem in this store software.  Some help from CubeCart Ltd would be greatly appreciated.  I have 3 client stores operating in CA and they are none too happy about this.


I would like to file a bug report but can't seem to find the CC bug tracker.  Anyone know where that is located?

It doesn't even pop up in a Google search, just a few links to forum posts about it being missing.

Link to comment
Share on other sites


The whole way that discount codes and gift certificate redemption works was rewritten as well the tax calculations around shipping were changed in 5.2.13 so that probably explains the change.

The old bug tracker was discontinued quite a while ago - your best route is to either log an official support ticket for priority support or if you have a github account and request to be added (https://github.com/cubecart/) then you can create an issue


Link to comment
Share on other sites

Thanks for the info.  I did file a support ticket and Al is going to take a look.


The change in 5.2.13 must be it.  I upgraded from 5.2.12 to 5.2.14 for all 3 stores and they started complaining this week when they noticed customers using coupons weren't being taxed enough.

Link to comment
Share on other sites

  • 2 weeks later...

This was fixed by changing;

$excluded_ave_tax_rate = ($excluded_tax_total / $excluded_subtotal);
$ave_tax_rate = ($ave_tax_rate + $excluded_ave_tax_rate) / 2;
$subtotal += $excluded_subtotal;


if($excluded_tax_total>0) {
   $excluded_ave_tax_rate = ($excluded_tax_total / $excluded_subtotal);
   $ave_tax_rate = ($ave_tax_rate + $excluded_ave_tax_rate) / 2;
$subtotal += $excluded_subtotal;

in the classes/cart.class.php file. 

Link to comment
Share on other sites

It is close, but still not completely accurate.  It isn't cutting the tax in half anymore, but it is rounding it.  The 8.25% rate is being calculated at 8% in the store when you use a coupon.  Without a coupon, it is still correct.  If you can kill the rounding of the tax percentage, I think you will have it.



Link to comment
Share on other sites

From my math (actually, my iPhone calculator's math), it looks right when I do some random shopping.


Thanks very much, I am off to put this into the other two stores. 


I assume this will be included in the next dot release so I won't have to tag it in my customization notes for my stores.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...