summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-07-22 10:29:05 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-07-22 10:29:05 +0700
commit71b30f5c313b0571ecf34c78ccc9887b57cfcbbc (patch)
treeb67c2c031d6fcc28efdffc299dac3a0e332cdfae /src/lib
parent8b8560742a16b46a114a86966e13ba59c1c248f6 (diff)
get discount value
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/checkout/components/Checkout.jsx10
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