diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-07-22 10:29:05 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-07-22 10:29:05 +0700 |
| commit | 71b30f5c313b0571ecf34c78ccc9887b57cfcbbc (patch) | |
| tree | b67c2c031d6fcc28efdffc299dac3a0e332cdfae /src/lib | |
| parent | 8b8560742a16b46a114a86966e13ba59c1c248f6 (diff) | |
get discount value
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/checkout/components/Checkout.jsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 23a471aa..5a9dcf7f 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -164,9 +164,9 @@ const Checkout = () => { let dataVoucherIndex = listVouchers.findIndex((voucher) => voucher.code == code) let dataActiveVoucher = listVouchers[dataVoucherIndex] - let countDiscount = 0 + let countDiscount = dataActiveVoucher.discountVoucher - if (dataActiveVoucher.discountType === 'percentage') { + /*if (dataActiveVoucher.discountType === 'percentage') { countDiscount = cartCheckout?.subtotal * (dataActiveVoucher.discountAmount / 100) if ( dataActiveVoucher.maxDiscountAmount > 0 && @@ -176,7 +176,7 @@ const Checkout = () => { } } else { countDiscount = dataActiveVoucher.discountAmount - } + }*/ return countDiscount } @@ -562,7 +562,9 @@ const Checkout = () => { {item.canApply && ( <p> Potensi potongan sebesar{' '} - <span className='text-red-500'>{item.discountVoucher}</span> + <span className='text-red-500'> + {currencyFormat(item.discountVoucher)} + </span> </p> )} {/* {item.canApply === false |
