From f305582bc3336a19c07a2a0d9b9636413bb8c8a5 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 27 Oct 2025 13:10:59 +0700 Subject: fix price detail product --- .../product-detail/components/PriceAction.tsx | 40 ++++++++++++++-------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index 683b679c..6cc2f0bf 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -95,28 +95,40 @@ const PriceAction = ({ product }: Props) => {
{activePrice.discount_percentage > 0 && ( - <> -
- {Math.floor(activePrice.discount_percentage)}% -
-
- Rp {formatCurrency(activePrice.price_discount || 0)} -
- +
+ {Math.floor(activePrice.discount_percentage)}% +
)} -
- Rp {formatCurrency(activePrice.price || 0)} +
+ Rp{' '} + {formatCurrency( + activePrice.discount_percentage > 0 + ? activePrice.price_discount || 0 + : activePrice.price || 0 + )}
+ {activePrice.discount_percentage > 0 && ( +
+ Rp {formatCurrency(activePrice.price || 0)} +
+ )}
Termasuk PPN: Rp{' '} - {formatCurrency(Math.round(activePrice.price_discount * PPN))} + {formatCurrency( + Math.round( + (activePrice.discount_percentage > 0 + ? activePrice.price_discount + : activePrice.price) * PPN + ) + )}
+
{activePrice.discount_percentage > 0 ? ( -- cgit v1.2.3