simpleCart(js)

items
Items:
Total:

simpleCart.quantity()

returns:

  • The total number of items in the cart, or the sum of the quantities of each unique item in the cart.
simpleCart.add({
  name: "Coffee Mug",
  price: 4,
  quantity: 1
});


simpleCart.add({
  name: "T-Shirt",
  price: 10,
  quantity: 2
})

simpleCart.quantity(); // 3

 

Comments

  1. There are no comments for this entry yet.
Commenting is not available in this channel entry.