(id)
| 33 | } |
| 34 | |
| 35 | decreaseQty(id) { |
| 36 | this.items[id].qty--; |
| 37 | this.items[id].price -= this.items[id].item.price; |
| 38 | this.items[id].price = parseFloat(this.items[id].price.toFixed(2)) |
| 39 | this.totalQty--; |
| 40 | this.totalPrice -= this.items[id].item.price |
| 41 | this.totalPrice = parseFloat(this.totalPrice.toFixed(2)) |
| 42 | if (this.items[id].qty <= 0) { |
| 43 | delete this.items[id]; |
| 44 | } |
| 45 | return this |
| 46 | } |
| 47 | |
| 48 | increaseQty(id) { |
| 49 | this.items[id].qty++; |