From b6ad7ba612489deb9ed74cffecdf1791f9de6705 Mon Sep 17 00:00:00 2001 From: Yury Shelest Date: Wed, 22 Jun 2022 16:25:45 +0000 Subject: [PATCH] Fix: "Unavailable in (currency)" on the storefront - support#215 --- utils/getPriceInCurrency.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/getPriceInCurrency.js b/utils/getPriceInCurrency.js index fc0c7f45..9f5f618f 100644 --- a/utils/getPriceInCurrency.js +++ b/utils/getPriceInCurrency.js @@ -1,3 +1,5 @@ +import isNumber from 'lodash/isNumber'; + export const getPriceInCurrency = (product, currency) => { const prices = { currency: currency.toLowerCase(), @@ -69,7 +71,7 @@ export const getStandardPriceInCurrency = (product, currency) => { const price = standardCurrency[currency]; if (price) { - if (standard.sale) { + if (standard.sale && isNumber(standard.salePrice)) { return price.salePrice; } @@ -90,7 +92,7 @@ export const getStandardPriceInCurrency = (product, currency) => { } if (product.currency === currency.toUpperCase() && product.price) { - if (product.sale) { + if (product.sale && isNumber(product.salePrice)) { return product.salePrice; }