I have been conducting extensive research on rounding at the cart item subtotal level, but I have not been able to find a solution.
What I want to do is to round the product subtotal after discout applied. Then caculate cart total and total by adding all product subtotal together.
I have tried different hooks such as:
- woocommerce_before_calculate_totals - This hook only allows me to modify the product price.
- woocommerce_cart_product_subtotal (filter) - This hook only affects the display of the cart item subtotal; it does not alter the calculation of the cart subtotal and total.
- woocommerce_calculate_totals - This hook only allows me to modify calculations based on the product price and quantity, and it is not directly related to the cart item subtotal.
If you have any suggestions or solutions, I would greatly appreciate your assistance. Thank you!