Hey guys, I had a 1.3.0.2 cart customer who wanted to have a percentage discount taken from the sub total, then shipping and tax applied to the new sub total amount. Tax was being calculated incorrectly and actually depending on the settings the Tax amount was deducted instead of added to the Total. The client has multiple tax rates.
I read several threads about the issues and they seem to become disjointed as people add extraneous bits. I wanted to post how I fixed mine to help anyone in the position I was.
First, I used Wilts code update from this thread, post #9:
http://www.zen-cart.com/forum/showthread.php?t=45213
This worked to fix the calc problem, but it was still calculating tax on the sub total.
I changed the sort order in Modules/Order Totals to
Sub-total 100
Discount Coupon 150
Tax 200
Shipping 250
I edited the Discount Coupon details thus;
Include Shipping False
Include tax False
Re-calculate Tax Standard
Here is an example of a total in a test cart with a tax rate of 5.92% and a discount coupon (56267) of 50%*
$268.00 Sub-Total:
-$134.00 Discount Coupon: 56267 :
$7.91 Avery City Tax:
$5.00 Flat Rate (Best Way):
$146.91 Total:
The tax calc seems to be off a penny and round down, but generally it is a good fix in this situation. I was looking at Configuration/My Store and Tax Decimal Places for possible help with the tax rounding. If I find a solution for it I will post it here.






Bookmarks