diff --git a/front-ui/app/stores/cartStore.js b/front-ui/app/stores/cartStore.js index 254ae8c..ed3f224 100644 --- a/front-ui/app/stores/cartStore.js +++ b/front-ui/app/stores/cartStore.js @@ -74,7 +74,17 @@ var CartStore = _.extend({}, EventEmitter.prototype, { getWholeCartState: function() { - var numberOfItems = _itemsInCart.models.filter(function(item) { return item.get('count') > 0 }).length; + var numberOfItems = 0; + + for (key in states) { + if(states.hasOwnProperty(key)){ + var value = states[key]; + if (value.get('count') > 0) { + numberOfItems++; + } + } + }; + var state = { count: numberOfItems };