From 032dfc6d64b50cc5491bd97ded995d737d34070c Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Sun, 14 Jun 2015 03:38:44 +0200 Subject: [PATCH] fixed bug with more than 10 items in cart --- front-ui/app/stores/cartStore.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/front-ui/app/stores/cartStore.js b/front-ui/app/stores/cartStore.js index 8ec470c..4263c2e 100644 --- a/front-ui/app/stores/cartStore.js +++ b/front-ui/app/stores/cartStore.js @@ -130,7 +130,15 @@ var addNItems = function(item, count) { _itemsForDisplay.add(item); - state.set('count', state.get('count') + count); + var realCount = state.get('count') + count; + + // remove if we choose to support more than + // 10 items of single type in cart + if (realCount > 10) { + realCount = 10; + + } + state.set('count', realCount); states[itemId] = state; saveCartStateForItem(itemId);