fixed bugs with cart notification number

This commit is contained in:
Senad Uka
2015-02-09 04:44:59 +01:00
parent 02925f8866
commit aeb75989cf

View File

@@ -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
};