Function: initCart()
initCart(
config):Promise<Cart>
Defined in: composables/shared/utils/cartInit.ts:68
Resolves the active cart for the current user. Returns an existing OPEN cart if one exists, otherwise creates and initialises a new cart with default addresses.
Parameters
config
The cart initialisation configuration.
Returns
Promise<Cart>
The resolved (existing or newly created) cart.
Remarks
Uses the Services.cart SDK service exclusively:
cart.getCartssearches for an existingOPENcart by contact/customer/company.cart.getCarthydrates the matched cart bycartId.cart.startCartcreates a new cart when no open cart is found.cart.updateCartAddressassigns the user's default invoice and delivery addresses to the new cart (best-effort; failures are swallowed).