In my case I had such values in the cart (product price 360 with 10% discount = 324)
$cart_amount = 324
$discount_amount = 0
$coupon_discount_amoun = 0
$item_sum (total_list_price) = 360
Which lead to negative tax value of -36
As possible solution to resolve that issue we can to use total_sale_price, not total_list_price in calculations like this ->
Expected behavior
Taxes should not show negative value
Actual behavior
Taxes showed as negative value
Steps to reproduce behavior
Screenshot/Video (if applicable)
Workaround or possible solution
On Cart_Mapper.php we have method calculate_total_tax, where tax calculation is happening.
In my case I had such values in the cart (product price 360 with 10% discount = 324) $cart_amount = 324 $discount_amount = 0 $coupon_discount_amoun = 0 $item_sum (total_list_price) = 360 Which lead to negative tax value of -36
As possible solution to resolve that issue we can to use total_sale_price, not total_list_price in calculations like this ->