From 410cc16690f97e59b6a93b4196a2c13caf498b4d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 19 Feb 2024 13:28:11 +0700 Subject: Add discount price on cart item --- src-migrate/modules/cart/components/Item.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src-migrate') diff --git a/src-migrate/modules/cart/components/Item.tsx b/src-migrate/modules/cart/components/Item.tsx index 7a4c22cc..8a6f8822 100644 --- a/src-migrate/modules/cart/components/Item.tsx +++ b/src-migrate/modules/cart/components/Item.tsx @@ -66,15 +66,21 @@ const CartItem = ({ item, editable = true }: Props) => { )} {item.cart_type === 'product' && ( - <> +
+ {item.price.discount_percentage > 0 && ( + + Rp {formatCurrency((item.price.price || 0))} + + )} +
- {item.price.price > 0 && `Rp ${formatCurrency(item.price.price)}`} - {item.price.price === 0 && '-'} + {item.price.price_discount > 0 && `Rp ${formatCurrency(item.price.price_discount)}`} + {item.price.price_discount === 0 && '-'}
-
{item.code}
- +
)} +
{item.cart_type === 'product' && item.code}
{item.weight} Kg
-- cgit v1.2.3