diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-09-09 10:01:12 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-09-09 10:01:12 +0700 |
| commit | afd84f86d2f26a3e0347dab7552060717030df19 (patch) | |
| tree | d63d095e16a6dd052fb7d6858e78c1aac1115794 /src-migrate/modules/cart/stores/useCartStore.ts | |
| parent | f8133c76306d9f70e01ac510c74dcfabe7f79b37 (diff) | |
| parent | 495b327ba0a45b17f4f0156f846ebe8bddbcd075 (diff) | |
Merge branch 'release' into CR/product_detail
# Conflicts:
# src-migrate/modules/product-detail/components/ProductDetail.tsx
Diffstat (limited to 'src-migrate/modules/cart/stores/useCartStore.ts')
| -rw-r--r-- | src-migrate/modules/cart/stores/useCartStore.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src-migrate/modules/cart/stores/useCartStore.ts b/src-migrate/modules/cart/stores/useCartStore.ts index 3b50ec32..c2ebf50f 100644 --- a/src-migrate/modules/cart/stores/useCartStore.ts +++ b/src-migrate/modules/cart/stores/useCartStore.ts @@ -54,7 +54,7 @@ export const useCartStore = create<State & Action>((set, get) => ({ const computeSummary = (cart: CartProps) => { let subtotal = 0; let discount = 0; - for (const item of cart.products) { + for (const item of cart?.products) { if (!item.selected) continue; let price = 0; @@ -71,4 +71,4 @@ const computeSummary = (cart: CartProps) => { let grandTotal = total + tax; return { subtotal, discount, total, tax, grandTotal }; -}; +};
\ No newline at end of file |
