diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-19 13:28:11 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-19 13:28:11 +0700 |
| commit | 410cc16690f97e59b6a93b4196a2c13caf498b4d (patch) | |
| tree | e9c810b476ca83de64c9db1bbba58989c22f32f0 | |
| parent | 2c4bd8d5640579222dc84e0026877fa92c445393 (diff) | |
Add discount price on cart item
| -rw-r--r-- | src-migrate/modules/cart/components/Item.tsx | 16 |
1 files changed, 11 insertions, 5 deletions
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' && ( - <> + <div className={style.discPriceSection}> + {item.price.discount_percentage > 0 && ( + <span className={style.priceBefore}> + Rp {formatCurrency((item.price.price || 0))} + </span> + )} + <div className={style.price}> - {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 && '-'} </div> - <div>{item.code}</div> - </> + </div> )} + <div>{item.cart_type === 'product' && item.code}</div> <div> {item.weight} Kg </div> |
