Parameters
NoneReturns
Promise<ShopifyCart>
Examples
Basic initialization
Initialize on page load
With subscription
Behavior
- Checks
sessionStoragefor an existing cart ID - If found, fetches the cart from Shopify
- If not found (or cart expired), creates a new cart
- Stores the cart ID in
sessionStorage - Notifies all subscribers with the cart state