Cart AJAX Infinite Loop on Zero Total
Summary:
When a WooCommerce cart's total is calculated to be $0.00, the AJAX process responsible for updating the cart totals on the front-end cart page enters an infinite loop. This results in the loading animation spinning indefinitely, making the page appear stuck and preventing the user from seeing the final calculated total or proceeding.
The bug occurs in a clean environment with only WooCommerce active and a default theme, indicating it is a core issue. The root cause is likely an error in the AJAX callback logic that handles the calculation and return of a zero-value total, causing the front-end script to continuously retry the request.
This bug creates a poor user experience for customers using coupons, gift cards, or free products, as they cannot complete their purchase on the cart page.
How to Replicate:
- Create a new simple product in WooCommerce.
- Set the product's regular price to 0.
- Add this product to the cart.
- Navigate to the Cart page (/cart/).
- Observe the infinite loading spinner in the cart totals section.