diff --git a/templates/demo-store/src/lib/utils.ts b/templates/demo-store/src/lib/utils.ts index dee120b7b4..6e5397d915 100644 --- a/templates/demo-store/src/lib/utils.ts +++ b/templates/demo-store/src/lib/utils.ts @@ -56,7 +56,9 @@ export function isNewArrival(date: string, daysOld = 30) { } export function isDiscounted(price: MoneyV2, compareAtPrice: MoneyV2) { - if (compareAtPrice?.amount > price?.amount) { + const priceAmount = Number(price.amount); + const compareAtPriceAmount = Number(compareAtPrice.amount); + if (compareAtPriceAmount > priceAmount) { return true; } return false;