API Reference

Add product

Adds a product to the shopping cart. If the product already exists, the quantity will be incremented.

Data Format

PropertyTypeRequiredDescription
idnumberYesId of the product
quantitynumberNoThe quantity
variantsstring[]NoList of variants, e.g. if the color is 'Red' and the size is '42' provide [‘Red, ‘42’]

Example

nextchapter.app.cart.v1.addProduct({
  id: 1,
  quantity: 2,
  variants: ['Red','42']
});