headless-commerce
    Preparing search index...

    Interface CartContextValue

    Public cart context contract exposed through useCart.

    interface CartContextValue {
        addItem: (product: Product, quantity?: number) => void;
        clearCart: () => void;
        closeCart: () => void;
        decrementItem: (slug: string) => void;
        incrementItem: (slug: string) => void;
        isOpen: boolean;
        itemCount: number;
        items: readonly CartLineItem[];
        openCart: () => void;
        removeItem: (slug: string) => void;
        subtotalCents: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    addItem: (product: Product, quantity?: number) => void
    clearCart: () => void
    closeCart: () => void
    decrementItem: (slug: string) => void
    incrementItem: (slug: string) => void
    isOpen: boolean
    itemCount: number
    items: readonly CartLineItem[]
    openCart: () => void
    removeItem: (slug: string) => void
    subtotalCents: number