Cart item total reflects total number of items in the cart

This commit is contained in:
Rob Harrington
2015-01-16 16:06:51 +11:00
parent d04e843315
commit 1d80bee595
3 changed files with 22 additions and 10 deletions

View File

@@ -43,6 +43,11 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http)->
@line_items.filter (li)->
li.quantity > 0
total_item_count: =>
@line_items_present().reduce (sum,li) ->
sum = sum + li.quantity
, 0
empty: =>
@line_items_present().length == 0