Use useCart.getState() to ensure we're clearing the current store state and delete IndexedDB before clearing store. Add detailed logging to help debug cart clearing issues. Ensures cart is completely emptied on checkout success.
Use useCart.getState() to ensure we're clearing the current store state and delete IndexedDB before clearing store. Add detailed logging to help debug cart clearing issues. Ensures cart is completely emptied on checkout success.