snapjay / ngCart

Really simple shopping cart for AngularJS
http://ngcart.snapjay.com
380 stars 236 forks source link

addItem() does not behave properly when optionnal parameter quantity is not set #7

Closed humbkr closed 9 years ago

humbkr commented 9 years ago

When addItem() is called without a quantity set, the setQuantity() method set the value of this._quantity to 1 instead of adding 1 to the total quantity.

The problem is the line 267 of ngCart.js: this._quantity = 1; should be this._quantity++;

I think this is an issue as quantity is an optionnal parameter.

snapjay commented 9 years ago

I don't understand this issue here? - How can you increment a value if it hasn't been set yet. If quantity is not set then it is defaulted to 1.

snapjay commented 9 years ago

Ah ok I see what you're saying - Lets continue this discussion in #11