diff --git a/packages/plugin-ecommerce/src/ui/PriceCell/index.tsx b/packages/plugin-ecommerce/src/ui/PriceCell/index.tsx index 99e0014b891..100c949ba09 100644 --- a/packages/plugin-ecommerce/src/ui/PriceCell/index.tsx +++ b/packages/plugin-ecommerce/src/ui/PriceCell/index.tsx @@ -20,23 +20,17 @@ export const PriceCell: React.FC = (args) => { const { cellData, currenciesConfig, currency: currencyFromProps, rowData } = args const currency = currencyFromProps || currenciesConfig.supportedCurrencies[0] + const hasValidCellData = typeof cellData === 'number' && !Number.isNaN(cellData) if (!currency) { - // @ts-expect-error - plugin translations are not typed yet return {t('plugin-ecommerce:currencyNotSet')} } - if ( - (!cellData || typeof cellData !== 'number') && - 'enableVariants' in rowData && - rowData.enableVariants - ) { - // @ts-expect-error - plugin translations are not typed yet + if (!hasValidCellData && 'enableVariants' in rowData && rowData.enableVariants) { return {t('plugin-ecommerce:priceSetInVariants')} } - if (!cellData) { - // @ts-expect-error - plugin translations are not typed yet + if (!hasValidCellData) { return {t('plugin-ecommerce:priceNotSet')} }