Skip to content

Oc 2101 mini cart badge#83

Merged
crhistianramirez merged 6 commits intoordercloud-api:developmentfrom
amrarick26:OC-2101_MiniCartBadge
May 16, 2017
Merged

Oc 2101 mini cart badge#83
crhistianramirez merged 6 commits intoordercloud-api:developmentfrom
amrarick26:OC-2101_MiniCartBadge

Conversation

@amrarick26
Copy link
Contributor

Display total quantity of products in cart, as opposed to total line items in cart

refactor: display total quantity instead of total line items on mini cart badge
refactor: display total quantity instead of total line items on mini cart badge
refactor: display total quantity instead of total line items on mini cart badge
refactor: fix for what data is displayed on mini cart from nav template
$rootScope.$on('OC:UpdateTotalQuantity', function(event, lineItems, add, difference) {
if (lineItems.length >= 1) {
var quantities = _.pluck(lineItems, 'Quantity');
return vm.totalQuantity = quantities.reduce(function(a, b) {return a + b}, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't make sense to put a return here because its not a function thats returning something, its just executing something in response to an event.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with the other returns in this block

refactor: remove returns from event listener
@crhistianramirez crhistianramirez merged commit 3a67e8b into ordercloud-api:development May 16, 2017
crhistianramirez pushed a commit to Four51/demo-angular-buyer that referenced this pull request Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants