From 9c5bb8cd9d9b7bf5a1632d9b9cc998950fd993e7 Mon Sep 17 00:00:00 2001 From: Jorge Moya Date: Mon, 18 Mar 2024 17:56:24 -0500 Subject: [PATCH] feat(core): hide handling cost if no cost associated (#671) --- .changeset/wet-students-fry.md | 5 +++++ .../cart/_components/shipping-estimator.tsx | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .changeset/wet-students-fry.md diff --git a/.changeset/wet-students-fry.md b/.changeset/wet-students-fry.md new file mode 100644 index 0000000000..63082af88d --- /dev/null +++ b/.changeset/wet-students-fry.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": minor +--- + +Hide handling cost in shipping estimate if there is no cost associated. diff --git a/apps/core/app/[locale]/(default)/cart/_components/shipping-estimator.tsx b/apps/core/app/[locale]/(default)/cart/_components/shipping-estimator.tsx index f0982e8e4c..1c83b9a6d7 100644 --- a/apps/core/app/[locale]/(default)/cart/_components/shipping-estimator.tsx +++ b/apps/core/app/[locale]/(default)/cart/_components/shipping-estimator.tsx @@ -55,12 +55,14 @@ export const ShippingEstimator = ({ key={shippingCosts.selectedShippingOption} /> -
- {t('handlingCost')} - - {currencyFormatter.format(shippingCosts.handlingCostTotal)} - -
+ {Boolean(shippingCosts.handlingCostTotal) && ( +
+ {t('handlingCost')} + + {currencyFormatter.format(shippingCosts.handlingCostTotal)} + +
+ )} ) : (