Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Don't show saving badge if the value is negative #2955

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './style.scss';

const ProductPrice = ( { className, currency, regularValue, value } ) => {
const isDiscounted =
Number.isFinite( regularValue ) && regularValue !== value;
Number.isFinite( regularValue ) && regularValue > value;

if ( isDiscounted ) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ProductBadge from '../product-badge';
* @return {*} The component.
*/
const ProductSaleBadge = ( { currency, saleAmount } ) => {
if ( ! saleAmount ) {
if ( ! saleAmount || saleAmount <= 0 ) {
return null;
}
return (
Expand Down