Skip to content

Commit

Permalink
Merge pull request #65 from vtex-apps/fix/free-price
Browse files Browse the repository at this point in the history
CHK-261: Fix price not shown as free label when it is zero
  • Loading branch information
lucasecdb authored Aug 26, 2020
2 parents c8aecd6 + 5631db8 commit 2f2077e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Price not shown as "free" label when it is zero.

## [0.21.0] - 2020-07-29
### Added
Expand Down
10 changes: 7 additions & 3 deletions react/Price.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ const Price: StorefrontFunctionComponent<PriceProps> = ({
id={`price-${item.id}`}
className={`${handles.productPrice} div fw6 fw5-m`}
>
{item.sellingPrice && (
<FormattedPrice value={(item.sellingPrice * item.quantity) / 100} />
)}
<FormattedPrice
value={
item.sellingPrice != null
? (item.sellingPrice * item.quantity) / 100
: item.sellingPrice
}
/>
</div>
</div>
)
Expand Down
4 changes: 2 additions & 2 deletions react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"skipLibCheck": true,
"sourceMap": true,
"strictFunctionTypes": true,
Expand Down

0 comments on commit 2f2077e

Please sign in to comment.