From 1dccd128c70696fa096128b0383d84b826595ee7 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Sat, 23 Aug 2025 12:04:15 +0700 Subject: Fix Price --- .../product-detail/components/PriceAction.tsx | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src-migrate/modules') diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index a90faee0..25a1aa47 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -112,22 +112,32 @@ const PriceAction = ({ product }: Props) => {
- {activePrice.discount_percentage > 0 && ( + {activePrice.discount_percentage > 0 ? ( <>
{Math.floor(activePrice.discount_percentage)}% -
{' '} +
+ + {/* harga setelah diskon (main-price) di kiri */}
Rp {formatCurrency(activePrice.price_discount || 0)}
+ + {/* harga coret di kanan */} +
+ Rp {formatCurrency(activePrice.price || 0)} +
+ ) : ( + // kalau tidak ada diskon, tampilkan harga normal saja +
+ Rp {formatCurrency(activePrice.price || 0)} +
)} -
- Rp {formatCurrency(activePrice.price || 0)} -
-
- Termasuk PPN: Rp{' '} + +
+ Termasuk PPN: Rp{' '} {formatCurrency(Math.round(activePrice.price_discount * PPN))}
@@ -148,7 +158,7 @@ const PriceAction = ({ product }: Props) => { )} -
+
{/* Qty */}
-- cgit v1.2.3