From 30da2d088793cabfb3c5b21d4560df53187e7047 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 20 Feb 2024 16:30:43 +0700 Subject: Fix item url in cart item --- src-migrate/modules/cart/components/Item.tsx | 10 ++++++++-- src-migrate/modules/cart/components/ItemPromo.tsx | 4 ++-- src-migrate/types/cart.ts | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src-migrate') diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index ba7f7cdf..d2bbdbdd 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -112,7 +112,10 @@ CartItem.Image = function CartItemImage({ item }: { item: CartItemProps }) { )} {item.cart_type === 'product' && ( - + {image && {item.name}} {!image &&
No Image
} @@ -129,7 +132,10 @@ CartItem.Name = function CartItemName({ item }: { item: CartItemProps }) { )} {item.cart_type === 'product' && ( - + {item.name} )} diff --git a/src-migrate/modules/cart/components/ItemPromo.tsx b/src-migrate/modules/cart/components/ItemPromo.tsx index d355c82a..878e17ac 100644 --- a/src-migrate/modules/cart/components/ItemPromo.tsx +++ b/src-migrate/modules/cart/components/ItemPromo.tsx @@ -13,12 +13,12 @@ type Props = { const CartItemPromo = ({ product }: Props) => { return (
- + {product?.image && {product.name}}
- + {product.display_name} diff --git a/src-migrate/types/cart.ts b/src-migrate/types/cart.ts index 3aceeac4..5a2cf4a9 100644 --- a/src-migrate/types/cart.ts +++ b/src-migrate/types/cart.ts @@ -9,6 +9,10 @@ type Price = { export type CartProduct = { id: number; image: string; + parent: { + id: number; + name: string; + }; display_name: string; name: string; code: string; -- cgit v1.2.3