summaryrefslogtreecommitdiff
path: root/src-migrate/modules/cart
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-11 14:10:18 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-11 14:10:18 +0700
commitd584d4620ff633e68fa37f98089d9056012e7b21 (patch)
tree4b154023bc18d87ace04e8ecc86de5d26429eb6e /src-migrate/modules/cart
parent061400a92ef10ac5f9eb1ac05a7b97bd4b3a0cd5 (diff)
<iman> add image promotion on keranjang
Diffstat (limited to 'src-migrate/modules/cart')
-rw-r--r--src-migrate/modules/cart/components/Item.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx
index 6ded6373..a757ba37 100644
--- a/src-migrate/modules/cart/components/Item.tsx
+++ b/src-migrate/modules/cart/components/Item.tsx
@@ -100,13 +100,15 @@ const CartItem = ({ item, editable = true }: Props) => {
CartItem.Image = function CartItemImage({ item }: { item: CartItemProps }) {
const image = item?.image || item?.parent?.image
+ const imageProgram = item?.image_program[0] || item?.parent?.image
+
- return (
+ return (
<>
{item.cart_type === 'promotion' && (
<div className={style.image}>
- {image && <Image src={image} alt={item.name} width={128} height={128} />}
- {!image && <div className={style.noImage}>No Image</div>}
+ {imageProgram && <Image src={imageProgram} alt={item.name} width={128} height={128} />}
+ {!imageProgram && <div className={style.noImage}>No Image</div>}
</div>
)}