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.
ClearCartOnMount now explicitly deletes the IndexedDB storage in addition
to clearing the in-memory state. This prevents the cart from being
restored from IndexedDB on subsequent page loads after payment completes.
Fixes issue where cart items remained in bag after successful checkout.
Use empty dependency array to ensure clear() runs once on mount.
Add logging and also clear isCheckingOut flag.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>