evoShop.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 = evoShop.add({ name: "Cool Thing" , price: 4, quantity: 5 });
    
    myItem.decrement();
    
    myItem.quantity(); // 4
    
    myItem.decrement( 2 );
    
    myItem.quantity(); // 2