summaryrefslogtreecommitdiff
path: root/src-migrate/modules/cart/components
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-07-11 08:38:37 +0000
committerIT Fixcomart <it@fixcomart.co.id>2024-07-11 08:38:37 +0000
commitde1bb091b148aa5ef2d5a168e19f1c2dac9e67b0 (patch)
tree1282a5abf21e8539df499d8172c1786ad413e9cc /src-migrate/modules/cart/components
parent0aa235cb03e92209d2bcbda8eda4c33d35e62e13 (diff)
parent46769b859bb56807d47053c3b99810455db12803 (diff)
Merged in Feature/all-promotion (pull request #159)
Feature/all promotion
Diffstat (limited to 'src-migrate/modules/cart/components')
-rw-r--r--src-migrate/modules/cart/components/Item.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx
index 6ded6373..a382279f 100644
--- a/src-migrate/modules/cart/components/Item.tsx
+++ b/src-migrate/modules/cart/components/Item.tsx
@@ -100,13 +100,14 @@ 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 ? 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>
)}