Represents operations for managing shopping carts.

interface CartManagement {
    AddItemToBasket: ((sci: AddToBasketObjectInstance) => MsBaseModel<ShoppingCartItemObject>);
    ClearCart: ((customer: number | Customer, shoppingCartType?: MsShoppingCartItemType) => boolean);
    DeleteItemFromBasket: ((sci: number | AddToBasketObjectInstance) => boolean);
    GetCartItemCount: ((customer: number | Customer, shoppingCartType?: MsShoppingCartItemType) => ShoppingCartItemCount);
    GetItemsFromBasket: ((customer: number | Customer, shoppingCartType?: MsShoppingCartItemType) => ShoppingCartItemObject[]);
    UpdateShoppingCartItem: ((sci: ShoppingCartItemObject) => MsModel);
}

Properties

Adds an item to the shopping basket.

Type declaration

ClearCart: ((customer: number | Customer, shoppingCartType?: MsShoppingCartItemType) => boolean)

Clears the shopping cart.

Type declaration

    • (customer, shoppingCartType?): boolean
    • Parameters

      • customer: number | Customer

        The ID of the customer or the customer object.

      • OptionalshoppingCartType: MsShoppingCartItemType

        Optional. The type of shopping cart to clear.

      Returns boolean

      A boolean indicating whether the cart was successfully cleared.

DeleteItemFromBasket: ((sci: number | AddToBasketObjectInstance) => boolean)

Deletes an item from the shopping basket.

Type declaration

    • (sci): boolean
    • Parameters

      Returns boolean

      A boolean indicating whether the item was successfully deleted.

GetCartItemCount: ((customer: number | Customer, shoppingCartType?: MsShoppingCartItemType) => ShoppingCartItemCount)

Retrieves the count of items in the shopping cart.

Type declaration

GetItemsFromBasket: ((customer: number | Customer, shoppingCartType?: MsShoppingCartItemType) => ShoppingCartItemObject[])

Retrieves items from the shopping basket.

Type declaration

UpdateShoppingCartItem: ((sci: ShoppingCartItemObject) => MsModel)

Updates a shopping cart item.

Type declaration