diff --git a/apps/storefront/src/pages/quote/QuoteDetail.tsx b/apps/storefront/src/pages/quote/QuoteDetail.tsx index a50c2cab..de698def 100644 --- a/apps/storefront/src/pages/quote/QuoteDetail.tsx +++ b/apps/storefront/src/pages/quote/QuoteDetail.tsx @@ -73,9 +73,8 @@ function QuoteDetail() { (taxZone: { id: number }) => taxZone.id === 1 ) if (defaultTaxZone) { - const { rates } = defaultTaxZone - const { enabled } = rates[0] - if (enabled && rates[0].classRates.length) { + const { rates = [] } = defaultTaxZone + if (rates.length && rates[0].enabled && rates[0].classRates.length) { rates[0].classRates.forEach((rate) => classRates.push(rate)) } } diff --git a/apps/storefront/src/utils/b3Product/b3TaxRate.ts b/apps/storefront/src/utils/b3Product/b3TaxRate.ts index e3ab80f3..51ebb740 100644 --- a/apps/storefront/src/utils/b3Product/b3TaxRate.ts +++ b/apps/storefront/src/utils/b3Product/b3TaxRate.ts @@ -11,14 +11,15 @@ const getTaxRate = (taxClassId: number) => { if (taxZoneRates.length) { const withValueTaxZoneRates = taxZoneRates.filter( - (taxZoneRate: TaxZoneRatesProps) => taxZoneRate.rates.length > 0 + (taxZoneRate: TaxZoneRatesProps) => + taxZoneRate.rates.length > 0 && taxZoneRate.enabled ) || [] if (withValueTaxZoneRates.length > 0) { const currentTaxZoneRate = withValueTaxZoneRates.find( (taxZoneRate: TaxZoneRatesProps) => - taxZoneRate.rates[0].priority === 1 + taxZoneRate.rates[0].priority === 0 && taxZoneRate.rates[0].enabled ) || withValueTaxZoneRates[0] taxRates = currentTaxZoneRate?.rates[0]?.classRates || [] diff --git a/apps/storefront/src/utils/storefrontConfig.ts b/apps/storefront/src/utils/storefrontConfig.ts index 45ee21f9..0057690f 100644 --- a/apps/storefront/src/utils/storefrontConfig.ts +++ b/apps/storefront/src/utils/storefrontConfig.ts @@ -294,17 +294,10 @@ const getStoreTaxZoneRates = async () => { ) if (defaultTaxZone) { const { - rates, priceDisplaySettings: { showInclusive }, } = defaultTaxZone - const { enabled } = rates[0] - if (enabled) { - B3SStorage.set('showInclusiveTaxPrice', showInclusive) - store.dispatch(setShowInclusiveTaxPrice(showInclusive)) - } else { - B3SStorage.set('showInclusiveTaxPrice', false) - store.dispatch(setShowInclusiveTaxPrice(false)) - } + B3SStorage.set('showInclusiveTaxPrice', showInclusive) + store.dispatch(setShowInclusiveTaxPrice(showInclusive)) } }