From 7e2f3ed92731d22fac2a2513af0e4acdbf99d389 Mon Sep 17 00:00:00 2001 From: Urvish Date: Wed, 11 Nov 2026 12:04:25 +0530 Subject: [PATCH] fix(cart): standardize complete package badge and UI layout in cart drawer --- src/components/cart/CartDrawer.tsx | 77 +++++++++++++++++++----------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/src/components/cart/CartDrawer.tsx b/src/components/cart/CartDrawer.tsx index 9fc9ae2..4f4b86a 100644 --- a/src/components/cart/CartDrawer.tsx +++ b/src/components/cart/CartDrawer.tsx @@ -113,36 +113,55 @@ export const CartDrawer: React.FC = ({ ) : (
- {cart.map((item) => ( -
-
-

{item.name}

-

{item.category}

+ {cart.map((item) => { + const isCompletePackage = + item.code === 'POINTS_PACK' || + item.code === 'PATTERN_CORE' || + item.code === 'NUTRITION_CORE' || + item.code === 'THERAPEUTICS_CORE' || + item.name.toLowerCase().includes('complete pack') || + item.name.toLowerCase().includes('complete package') || + item.name.toLowerCase().includes('complete bundle') || + item.category === 'Bundle'; + + return ( +
+
+
+

{item.name}

+ {isCompletePackage && ( + + Complete Pack + + )} +
+

{item.category}

+
+
+ + {(() => { + const calculatedItem = activePricing?.cart_items?.find((ci: any) => ci.code === item.code); + const price = calculatedItem + ? calculatedItem.price + : (currency === 'INR' ? item.priceInr : currency === 'EUR' ? item.priceEur : item.priceUsd); + const symbol = currency === 'INR' ? '₹' : currency === 'EUR' ? '€' : '$'; + return `${symbol}${price}`; + })()} + + +
-
- - {(() => { - const calculatedItem = activePricing?.cart_items?.find((ci: any) => ci.code === item.code); - const price = calculatedItem - ? calculatedItem.price - : (currency === 'INR' ? item.priceInr : currency === 'EUR' ? item.priceEur : item.priceUsd); - const symbol = currency === 'INR' ? '₹' : currency === 'EUR' ? '€' : '$'; - return `${symbol}${price}`; - })()} - - -
-
- ))} + ); + })}
)}