Skip to content

Commit

Permalink
fix(final-price): consider percentage default type for additions
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Oct 25, 2020
1 parent 8d54ff7 commit 2ef93a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/fix-item-final-price.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export default item => {
item.customizations.forEach(customization => {
if (customization.add_to_price) {
const { type, addition } = customization.add_to_price
item.final_price += type === 'percentage'
? item.price * addition / 100
: addition
item.final_price += type === 'fixed'
? addition
: item.price * addition / 100
}
})
}
Expand Down

0 comments on commit 2ef93a4

Please sign in to comment.