From c812f260ceb99df4c8904bad5a9cece0badccfcd Mon Sep 17 00:00:00 2001 From: Miqdad Date: Mon, 27 Oct 2025 10:18:32 +0700 Subject: fix price prod detail --- .../product-detail/components/PriceAction.tsx | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index 0a9cb2df..f8591b3a 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -66,17 +66,21 @@ const PriceAction = ({ product }: Props) => { setQuantityInput('1'); }, [selectedVariant]); - let voucherPastiHemat = 0; + const price = activePrice?.price_discount || activePrice?.price || 0; + const pricedigit = String(Math.floor(price)).length; + const fontSize = pricedigit > 9 ? '20px' : undefined; - if ( - product?.voucher_pasti_hemat - ? product?.voucher_pasti_hemat.length - : voucherPastiHemat > 0 - ) { - const stringVoucher = product?.voucher_pasti_hemat[0]; - const validJsonString = stringVoucher.replace(/'/g, '"'); - voucherPastiHemat = JSON.parse(validJsonString); - } + // let voucherPastiHemat = 0; + + // if ( + // product?.voucher_pasti_hemat + // ? product?.voucher_pasti_hemat.length + // : voucherPastiHemat > 0 + // ) { + // const stringVoucher = product?.voucher_pasti_hemat[0]; + // const validJsonString = stringVoucher.replace(/'/g, '"'); + // voucherPastiHemat = JSON.parse(validJsonString); + // } return (
{
)} -
+
Rp {formatCurrency(activePrice.price_discount || 0)}
-- cgit v1.2.3