Home > widget-integration > CartService > getCartItems
CartService.getCartItems() method
Get all items currently in the cart Returns empty array if cart is empty or on error
Signature:
getCartItems(): Promise<unknown[]>;
Returns:
Promise<unknown[]>
Promise resolving to array of cart items from Shopify (empty array on error)
Example
const items = await cartService.getCartItems();
console.log(`Cart has ${items.length} items`);