CartItem

Each item in the Cart is a CartItem.
A CartItem could represent a product variation or a package.

Usage

cartApi.add('apple', 3)
    .then(() => {
        var cartItem = cart.items[0];
        console.log(`There are ${cartItem.quantity} apples in the cart.`);
    });

Properties

Name Type Description
id String A unique identifier
name String The name of the product variation or package
quantity Number The total quantity of all items
quantityInStock Number
currency String Example: SEK
imageUrl Image
url String A url to a product page
discountPrice Price
discountPriceWithoutTax Price
listPrice Price The catalog price
listPriceWithoutTax Price
totalPrice Price
totalPriceWithoutTax Price
totalDiscount Price
meta Object An object that contains project-specific data.
For example, {color: 'green'}

Tests

Run unit tests