The recent update didn’t fix the underlying problem that caused the miscalculations on the Colorado Delivery Fee.
Changing around how the fee was being added seemed to correct the final total of the order, but the fee tax total is still incorrect. The fee tax total is incorrect because the fee tax is being added twice to the fee tax total.
In this file woocommerce-avatax/src/class-wc-avatax-checkout-handler.php on line 310:
$cart->set_fee_tax( $cart->get_fee_tax() + $line[‘tax’] );
the tax is being added to the fee tax total before the fee is even added.
Line 310 is redundant to line 349 which is:
$cart->set_fee_tax( $cart->get_fee_tax() + (float) $line[‘tax’] );
and is causing the tax fee total to be incorrect at $0.54. Therefore, line 310 should be removed.
Although, changing how the fee is added solved the miscalculation in certain circumstances it did not correct the underlying issue. In our case, we have free products that get shipped out. When these products are purchased, the delivery fee is still being added at $0.54 instead of the correct $0.27 fee. When purchasing products with cost the final total seems to be correct with the $0.27 fee, however in the cart/order object the fee tax total is still incorrect at $0.54 for all orders.
Side note, I’m not sure if the fee is supposed to be charged in the case of $0 orders? But I will leave that decision to tax specialists.
Please correct this issue.
Open
Last updated: June 27, 2023
0 comments
Log in to comment on this feature request.