From ca30c28dd0b19977eb771fc32ff5e520cdef1068 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Thu, 3 Oct 2024 16:47:37 +0700
Subject: product varian

---
 src-migrate/pages/shop/cart/index.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src-migrate/pages/shop/cart/index.tsx')

diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx
index c5386c91..70a28073 100644
--- a/src-migrate/pages/shop/cart/index.tsx
+++ b/src-migrate/pages/shop/cart/index.tsx
@@ -35,6 +35,8 @@ const CartPage = () => {
   const [hasChanged, setHasChanged] = useState(false);
   const prevCartRef = useRef<CartItem[] | null>(null);
 
+  console.log('ini cart', cart);
+
   useEffect(() => {
     const handleScroll = () => {
       setIsTop(window.scrollY < 200);
@@ -84,19 +86,19 @@ const CartPage = () => {
 
   const hasSelectedPromo = useMemo(() => {
     if (!cart) return false;
-    return cart.products.some(
+    return cart?.products?.some(
       (item) => item.cart_type === 'promotion' && item.selected
     );
   }, [cart]);
 
   const hasSelected = useMemo(() => {
     if (!cart) return false;
-    return cart.products.some((item) => item.selected);
+    return cart?.products?.some((item) => item.selected);
   }, [cart]);
 
   const hasSelectNoPrice = useMemo(() => {
     if (!cart) return false;
-    return cart.products.some(
+    return cart?.products?.some(
       (item) => item.selected && item.price.price_discount === 0
     );
   }, [cart]);
@@ -230,7 +232,7 @@ const CartPage = () => {
           </div>
 
           <div className={style['items']}>
-            {cart?.products.map((item) => (
+            {cart?.products?.map((item) => (
               <CartItemModule key={item.id} item={item} />
             ))}
 
-- 
cgit v1.2.3


From 9f10b502da7e1d102ddb0b16175b828834ff6f44 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 19 Nov 2024 10:50:07 +0700
Subject: <iman> delete console log

---
 src-migrate/pages/shop/cart/index.tsx | 2 --
 1 file changed, 2 deletions(-)

(limited to 'src-migrate/pages/shop/cart/index.tsx')

diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx
index 70a28073..24baa933 100644
--- a/src-migrate/pages/shop/cart/index.tsx
+++ b/src-migrate/pages/shop/cart/index.tsx
@@ -35,8 +35,6 @@ const CartPage = () => {
   const [hasChanged, setHasChanged] = useState(false);
   const prevCartRef = useRef<CartItem[] | null>(null);
 
-  console.log('ini cart', cart);
-
   useEffect(() => {
     const handleScroll = () => {
       setIsTop(window.scrollY < 200);
-- 
cgit v1.2.3

