summaryrefslogtreecommitdiff
path: root/src-migrate/pages
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-11-29 10:06:30 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-11-29 10:06:30 +0700
commitc7177ab35e35abac0aa322b054ad10d5690bf8de (patch)
treec3da3010e31a4fe453520dfc33fa5e0e52daa0b5 /src-migrate/pages
parent88198c83806b69ce6ab7815cee5c139536849c9f (diff)
parent952421c810b53ec4d25ad5ef605bae1bd1d5d616 (diff)
Merge branch 'new-release' into CR/quotation-noPo
Diffstat (limited to 'src-migrate/pages')
-rw-r--r--src-migrate/pages/shop/cart/index.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx
index c5386c91..24baa933 100644
--- a/src-migrate/pages/shop/cart/index.tsx
+++ b/src-migrate/pages/shop/cart/index.tsx
@@ -84,19 +84,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 +230,7 @@ const CartPage = () => {
</div>
<div className={style['items']}>
- {cart?.products.map((item) => (
+ {cart?.products?.map((item) => (
<CartItemModule key={item.id} item={item} />
))}