simpleCart(js)

items
Items:
Total:

simpleCart.Item.decrement( [amount] )

arguments:

  • amount (optional): number to decrement the quantity of the item by. If nothing is provided, item is incremented by 1

If the quantity of the item is 0 or less after it is decremented, the item is removed from the cart

var myItem = simpleCart.add({ name: "Cool Thing" , price: 4, quantity: 5 });

myItem.decrement();

myItem.quantity(); // 4

myItem.decrement( 2 );

myItem.quantity(); // 2


Comments

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