tastyigniter / ti-ext-cart

A TastyIgniter extension that allows you to easily add a shopping cart to your site.
MIT License
8 stars 32 forks source link

Tax is still added on top of discounted total of $0 #12

Closed jpaik closed 4 years ago

jpaik commented 4 years ago

Expected behavior: Tax rate is at 6.625% and is not inclusive. Add a product to cart. Apply a 100% off coupon. Subtotal is at $0 because of coupon. Tax should be $0, order total should be $0.

Actual behavior: Add a product to cart. Apply a 100% off coupon. Subtotal is at $0 because of coupon. Tax is $0.18 and so order total becomes $0.18

Reproduce steps: Set Tax Mode to be enabled and percentage to be anything and tax is applied on top of menu price. Create a coupon for 100% off. Add a product to cart and apply the coupon. The tax is still there even though it should be 100% off.

Version: (TastyIgniter version 3.0.4-beta.20.1)

Additional Information: Igniter Flame version 1.0.18

sampoyigi commented 4 years ago

Cart totals are calculated in the order set from the admin panel, so if the tax comes before the coupon it is applied to the total before the coupon is calculated. There have also been some improvements to the cart totals priority logic here https://github.com/tastyigniter/flame/commit/aac65eba9398797692d5a093d2a5db74fb35c5b1. Let me know if that helps.

jpaik commented 4 years ago

That improvement is perfect, thank you!