Skip to content

Commit

Permalink
Merge pull request #131 from gustavopvasconcellos/bugfix/removing-ass…
Browse files Browse the repository at this point in the history
…emblies

Removing assemblies from the items count
  • Loading branch information
Breno Calazans authored Dec 22, 2020
2 parents a9988de + dbf890c commit 600f362
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Removing assemblies from the items count

## [2.6.0] - 2020-12-17

### Added
Expand Down
7 changes: 6 additions & 1 deletion react/OrderTotal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ const CSS_HANDLES = [
const OrderTotal: FC = () => {
const { items, totals, value: totalValue } = useOrder()
const handles = useCssHandles(CSS_HANDLES)
const numItems = items.reduce((acc, item) => acc + item.quantity, 0)
const numItems = items.reduce((acc, item) => {
if (item.parentItemIndex === null) {
return acc + item.quantity
}
return acc
}, 0)
const [newTotals, taxes] = getTotals(totals)

return (
Expand Down

0 comments on commit 600f362

Please sign in to comment.