snapjay / ngCart

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

ngCart.totalItems() only returns the number of differents items in the cart #12

Closed humbkr closed 9 years ago

humbkr commented 9 years ago

If I have 3 differents items in my cart, each one with a quantity of 3, ngCart.totalItems() returns 3, not 9.

It seems wrong, if I'm on the products pages and I add the same item twice, ie I update the quantity of an item in my cart, in the summary I should see a difference in the number of items. Currently I only see a difference in the total price, which seems not intuitive at all. See commerce websites like Amazon to see the right behaviour.

Different solutions:

snapjay commented 9 years ago

I had build this intending totalItems() would return 'unique' items in your cart - but seeing how Amazon do this, that does make sense. I will conciser changing this.

snapjay commented 9 years ago

This has been added to the Master branch