From 19f6ce87e9f6e0a5c2cfbae2cf8eabee777f011a Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 12 Jul 2024 13:34:56 +0700 Subject: update flash sale --- src/lib/checkout/components/Checkout.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 4aafdece..77c3590b 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -225,7 +225,8 @@ const Checkout = () => { setProducts(cartCheckout?.products); setCheckWeight(cartCheckout?.hasProductWithoutWeight); setTotalWeight(cartCheckout?.totalWeight.g); - setHasFlashSale(cartCheckout?.products[0]?.hasFlashsale ? cartCheckout.products[0].hasFlashsale : false); + const hasFlashSale = cartCheckout?.products.some(product => product.hasFlashsale); + setHasFlashSale(hasFlashSale); }, [cartCheckout]); -- cgit v1.2.3