From f3aa76b1810b3bc8b25bd02c76b50384893fc453 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 6 Aug 2024 15:12:56 +0700 Subject: voucher --- src/lib/checkout/api/getVoucher.js | 1 + src/lib/checkout/components/Checkout.jsx | 118 ++++++++++++++++++++++--------- 2 files changed, 87 insertions(+), 32 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/api/getVoucher.js b/src/lib/checkout/api/getVoucher.js index 779cef43..ead4ffbe 100644 --- a/src/lib/checkout/api/getVoucher.js +++ b/src/lib/checkout/api/getVoucher.js @@ -3,6 +3,7 @@ import { getAuth } from '@/core/utils/auth' export const getVoucher = async (id, query) => { const queryParam = new URLSearchParams(query); + console.log('ini params string',queryParam.toString()) const url = `/api/v1/user/${id}/voucher?${queryParam.toString()}`; const dataVoucher = await odooApi('GET', url); return dataVoucher; diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 09a791ee..84f68dab 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -131,6 +131,7 @@ const Checkout = () => { setLoadingVoucher(true); let dataVoucher = await getVoucher(auth?.id, { source: query, + type: 'all,brand', }); SetListVoucher(dataVoucher); @@ -146,40 +147,71 @@ const Checkout = () => { }; const VoucherCode = async (code) => { - const source = 'code=' + code + '&source=' + query; // let dataVoucher = await findVoucher(code, auth.id, query); - let dataVoucher = await getVoucherNew(source); + let dataVoucher = await getVoucher(auth?.id, { + source: query, + code: code + }); if (dataVoucher.length <= 0) { SetFindVoucher(1); return; } let addNewLine = dataVoucher[0]; - let checkList = listVouchers?.findIndex( - (voucher) => voucher.code == addNewLine.code - ); - if (checkList >= 0) { - if (listVouchers[checkList].canApply) { - ToggleSwitch(code); - SetCodeVoucher(null); - } else { - SetSelisihHargaCode(listVouchers[checkList].differenceToApply); + console.log('addNewLine', addNewLine); + if (addNewLine.applyType != 'shipping') { + let checkList = listVouchers?.findIndex( + (voucher) => voucher.code == addNewLine.code + ); + if (checkList >= 0) { + if (listVouchers[checkList].canApply) { + ToggleSwitch(code); + SetCodeVoucher(null); + } else { + SetSelisihHargaCode(listVouchers[checkList].differenceToApply); + SetFindVoucher(2); + } + return; + } + if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { + SetSelisihHargaCode( + currencyFormat(addNewLine.minPurchaseAmount - cartCheckout?.subtotal) + ); SetFindVoucher(2); + return; + } else { + SetFindVoucher(3); + SetButtonTerapkan(true); } - return; - } - if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { - SetSelisihHargaCode( - currencyFormat(addNewLine.minPurchaseAmount - cartCheckout?.subtotal) - ); - SetFindVoucher(2); - return; + SetListVoucher((prevList) => [addNewLine, ...prevList]); + SetActiveVoucher(addNewLine.code); } else { - SetFindVoucher(3); - SetButtonTerapkan(true); + let checkList = listVoucherShippings?.findIndex( + (voucher) => voucher.code == addNewLine.code + ); + if (checkList >= 0) { + if (listVoucherShippings[checkList].canApply) { + ToggleSwitch(code); + SetCodeVoucher(null); + } else { + SetSelisihHargaCode(listVoucherShippings[checkList].differenceToApply); + SetFindVoucher(2); + } + return; + } + if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { + SetSelisihHargaCode( + currencyFormat(addNewLine.minPurchaseAmount - cartCheckout?.subtotal) + ); + SetFindVoucher(2); + return; + } else { + SetFindVoucher(3); + SetButtonTerapkan(true); + } + SetListVoucherShipping((prevList) => [addNewLine, ...prevList]); + setActiveVoucherShipping(addNewLine.code); } - SetListVoucher((prevList) => [addNewLine, ...prevList]); - SetActiveVoucher(addNewLine.code); }; useEffect(() => { @@ -187,7 +219,7 @@ const Checkout = () => { }, [bottomPopup]); useEffect(() => { - voucher(); + // voucher(); const loadExpedisi = async () => { let dataExpedisi = await ExpedisiList(); dataExpedisi = dataExpedisi.map((expedisi) => ({ @@ -210,13 +242,24 @@ const Checkout = () => { }; }, []); - const hitungDiscountVoucher = (code) => { - let dataVoucherIndex = listVouchers.findIndex( - (voucher) => voucher.code == code - ); - let dataActiveVoucher = listVouchers[dataVoucherIndex]; - - let countDiscount = dataActiveVoucher.discountVoucher; + const hitungDiscountVoucher = (code, source) => { + let countDiscount = 0; + if(source === 'voucher'){ + let dataVoucherIndex = listVouchers.findIndex( + (voucher) => voucher.code == code + ); + let dataActiveVoucher = listVouchers[dataVoucherIndex]; + + countDiscount = dataActiveVoucher.discountVoucher; + }else{ + let dataVoucherIndex = listVoucherShippings.findIndex( + (voucher) => voucher.code == code + ); + let dataActiveVoucher = listVoucherShippings[dataVoucherIndex]; + + countDiscount = dataActiveVoucher.discountVoucher; + } + /*if (dataActiveVoucher.discountType === 'percentage') { countDiscount = cartCheckout?.subtotal * (dataActiveVoucher.discountAmount / 100) @@ -237,11 +280,22 @@ const Checkout = () => { if (!listVouchers) return; if (!activeVoucher) return; - const countDiscount = hitungDiscountVoucher(activeVoucher); + console.log('voucher') + const countDiscount = hitungDiscountVoucher(activeVoucher, 'voucher'); SetDiscountVoucher(countDiscount); }, [activeVoucher, listVouchers]); + useEffect(() => { + if (!listVoucherShippings) return; + if (!activeVoucherShipping) return; + + console.log('voucher shipping') + const countDiscount = hitungDiscountVoucher(activeVoucherShipping, 'voucher_shipping'); + + SetDiscountVoucher(countDiscount); + }, [activeVoucherShipping, listVoucherShippings]); + useEffect(() => { if (qVoucher === 'PASTIHEMAT' && listVouchers) { let code = qVoucher; -- cgit v1.2.3 From e8745f729cb48a2cab96f8f216617240326f2018 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 13 Aug 2024 14:39:08 +0700 Subject: add feature pickup service --- src/lib/checkout/components/Checkout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 09a791ee..5f771f41 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -1295,7 +1295,7 @@ const Checkout = () => {
{!!products && snakecaseKeys(products).map((item, index) => ( - + ))}
-- cgit v1.2.3 From ad82ceb618565eec7b1e955c8ba12243d26253f1 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Thu, 15 Aug 2024 11:27:35 +0700 Subject: update view --- src/lib/checkout/components/Checkout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 5f771f41..6deba693 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -1004,7 +1004,7 @@ const Checkout = () => {
{!!products && snakecaseKeys(products).map((item, index) => ( - + ))}
-- cgit v1.2.3 From 67731281227f961c9b56f9f310951a8e5c82ab39 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Fri, 23 Aug 2024 14:19:05 +0700 Subject: bug fixing checkout ios env --- src/lib/checkout/components/Checkout.jsx | 40 ++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 09a791ee..47f148d1 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -389,12 +389,38 @@ const Checkout = () => { if (typeof file !== 'undefined') data.po_file = await getFileBase64(file); const isCheckouted = await checkoutApi({ data }); + if (!isCheckouted?.id) { toast.error('Gagal melakukan transaksi, terjadi kesalahan internal'); return; - } + } else { + gtagPurchase(products, biayaKirim, isCheckouted.name); + + gtag('event', 'conversion', { + send_to: 'AW-954540379/nDymCL3BhaQYENvClMcD', + value: + cartCheckout?.grandTotal + + Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000, + currency: 'IDR', + transaction_id: isCheckouted.id, + }); - gtagPurchase(products, biayaKirim, isCheckouted.name); + for (const product of products) deleteItemCart({ productId: product.id }); + if (grandTotal > 0) { + const payment = await axios.post( + `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/midtrans-payment?transactionId=${isCheckouted.id}` + ); + setIsLoading(false); + window.location.href = payment.data.redirectUrl; + } else { + window.location.href = `${ + process.env.NEXT_PUBLIC_SELF_HOST + }/shop/checkout/success?order_id=${isCheckouted.name.replace( + /\//g, + '-' + )}`; + } + } const midtrans = async () => { for (const product of products) deleteItemCart({ productId: product.id }); @@ -413,16 +439,6 @@ const Checkout = () => { )}`; } }; - - gtag('event', 'conversion', { - send_to: 'AW-954540379/nDymCL3BhaQYENvClMcD', - value: - cartCheckout?.grandTotal + - Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000, - currency: 'IDR', - transaction_id: isCheckouted.id, - event_callback: midtrans, - }); }; const handlingActivateCode = async () => { -- cgit v1.2.3 From 1bfd8851c66f4029ee6e5088b3776819bf61f4b7 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 28 Aug 2024 14:58:42 +0700 Subject: voucher shipping code --- src/lib/checkout/components/Checkout.jsx | 206 ++++++++++++++++++------------- 1 file changed, 121 insertions(+), 85 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 384e7105..2e3d4e58 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -150,68 +150,88 @@ const Checkout = () => { // let dataVoucher = await findVoucher(code, auth.id, query); let dataVoucher = await getVoucher(auth?.id, { source: query, - code: code + code: code, }); if (dataVoucher.length <= 0) { SetFindVoucher(1); return; } - let addNewLine = dataVoucher[0]; - console.log('addNewLine', addNewLine); - if (addNewLine.applyType != 'shipping') { - let checkList = listVouchers?.findIndex( - (voucher) => voucher.code == addNewLine.code - ); - if (checkList >= 0) { - if (listVouchers[checkList].canApply) { - ToggleSwitch(code); - SetCodeVoucher(null); - } else { - SetSelisihHargaCode(listVouchers[checkList].differenceToApply); + dataVoucher.forEach((addNewLine) => { + if (addNewLine.applyType !== 'shipping') { + // Mencari voucher dalam listVouchers + let checkList = listVouchers?.findIndex( + (voucher) => voucher.code === addNewLine.code + ); + + if (checkList >= 0) { + if (listVouchers[checkList].canApply) { + ToggleSwitch(addNewLine.code); // Perbaikan: Gunakan code voucher yang benar + SetCodeVoucher(null); + } else { + SetSelisihHargaCode(listVouchers[checkList].differenceToApply); + SetFindVoucher(2); + } + return; // Hentikan eksekusi lebih lanjut pada iterasi ini + } + + // Memeriksa apakah subtotal memenuhi syarat minimal pembelian + if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { + SetSelisihHargaCode( + currencyFormat( + addNewLine.minPurchaseAmount - cartCheckout?.subtotal + ) + ); SetFindVoucher(2); + return; + } else { + SetFindVoucher(3); + SetButtonTerapkan(true); } - return; - } - if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { - SetSelisihHargaCode( - currencyFormat(addNewLine.minPurchaseAmount - cartCheckout?.subtotal) - ); - SetFindVoucher(2); - return; + + // Tambahkan voucher ke list dan set voucher aktif + SetListVoucher((prevList) => [addNewLine, ...prevList]); + SetActiveVoucher(addNewLine.code); } else { - SetFindVoucher(3); - SetButtonTerapkan(true); - } - SetListVoucher((prevList) => [addNewLine, ...prevList]); - SetActiveVoucher(addNewLine.code); - } else { - let checkList = listVoucherShippings?.findIndex( - (voucher) => voucher.code == addNewLine.code - ); - if (checkList >= 0) { - if (listVoucherShippings[checkList].canApply) { - ToggleSwitch(code); - SetCodeVoucher(null); - } else { - SetSelisihHargaCode(listVoucherShippings[checkList].differenceToApply); + // Mencari voucher dalam listVoucherShippings + let checkList = listVoucherShippings?.findIndex( + (voucher) => voucher.code === addNewLine.code + ); + + if (checkList >= 0) { + if (listVoucherShippings[checkList].canApply) { + ToggleSwitch(addNewLine.code); // Perbaikan: Gunakan code voucher yang benar + SetCodeVoucher(null); + } else { + SetSelisihHargaCode( + listVoucherShippings[checkList].differenceToApply + ); + SetFindVoucher(2); + } + return; // Hentikan eksekusi lebih lanjut pada iterasi ini + } + + // Memeriksa apakah subtotal memenuhi syarat minimal pembelian + if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { + SetSelisihHargaCode( + currencyFormat( + addNewLine.minPurchaseAmount - cartCheckout?.subtotal + ) + ); SetFindVoucher(2); + return; + } else { + SetFindVoucher(3); + SetButtonTerapkan(true); } - return; - } - if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { - SetSelisihHargaCode( - currencyFormat(addNewLine.minPurchaseAmount - cartCheckout?.subtotal) - ); - SetFindVoucher(2); - return; - } else { - SetFindVoucher(3); - SetButtonTerapkan(true); + + // Tambahkan voucher ke list pengiriman dan set voucher aktif pengiriman + SetListVoucherShipping((prevList) => [addNewLine, ...prevList]); + setActiveVoucherShipping(addNewLine.code); } - SetListVoucherShipping((prevList) => [addNewLine, ...prevList]); - setActiveVoucherShipping(addNewLine.code); - } + }); + + // let addNewLine = dataVoucher[0]; }; useEffect(() => { @@ -244,22 +264,21 @@ const Checkout = () => { const hitungDiscountVoucher = (code, source) => { let countDiscount = 0; - if(source === 'voucher'){ + if (source === 'voucher') { let dataVoucherIndex = listVouchers.findIndex( (voucher) => voucher.code == code ); let dataActiveVoucher = listVouchers[dataVoucherIndex]; - + countDiscount = dataActiveVoucher.discountVoucher; - }else{ + } else { let dataVoucherIndex = listVoucherShippings.findIndex( (voucher) => voucher.code == code ); let dataActiveVoucher = listVoucherShippings[dataVoucherIndex]; - + countDiscount = dataActiveVoucher.discountVoucher; } - /*if (dataActiveVoucher.discountType === 'percentage') { countDiscount = cartCheckout?.subtotal * (dataActiveVoucher.discountAmount / 100) @@ -276,25 +295,24 @@ const Checkout = () => { return countDiscount; }; - useEffect(() => { - if (!listVouchers) return; - if (!activeVoucher) return; + // useEffect(() => { + // if (!listVouchers) return; + // if (!activeVoucher) return; - console.log('voucher') - const countDiscount = hitungDiscountVoucher(activeVoucher, 'voucher'); + // console.log('voucher') + // const countDiscount = hitungDiscountVoucher(activeVoucher, 'voucher'); - SetDiscountVoucher(countDiscount); - }, [activeVoucher, listVouchers]); + // SetDiscountVoucher(countDiscount); + // }, [activeVoucher, listVouchers]); - useEffect(() => { - if (!listVoucherShippings) return; - if (!activeVoucherShipping) return; + // useEffect(() => { + // if (!listVoucherShippings) return; + // if (!activeVoucherShipping) return; - console.log('voucher shipping') - const countDiscount = hitungDiscountVoucher(activeVoucherShipping, 'voucher_shipping'); + // const countDiscount = hitungDiscountVoucher(activeVoucherShipping, 'voucher_shipping'); - SetDiscountVoucher(countDiscount); - }, [activeVoucherShipping, listVoucherShippings]); + // SetDiscountVoucherOngkir(countDiscount); + // }, [activeVoucherShipping, listVoucherShippings]); useEffect(() => { if (qVoucher === 'PASTIHEMAT' && listVouchers) { @@ -553,6 +571,10 @@ const Checkout = () => { const finalShippingAmt = biayaKirim - discShippingAmt; + const totalDiscountVoucher = + cartCheckout?.discountVoucher + + (cartCheckout?.discountVoucherShipping || 0); + return ( <> { )}
+ {/* {!loadingVoucher && + listVouchers?.length === 1 && + listVoucherShippings?.length === 1} + { +
+
+

Tidak ada voucher tersedia

+

+ Maaf, saat ini tidak ada voucher yang tersedia. +

+
+
+ } */} {listVoucherShippings && listVoucherShippings?.length > 0 && (
@@ -801,16 +836,7 @@ const Checkout = () => {
- {!loadingVoucher && listVouchers?.length === 0 ? ( -
-
-

Tidak ada voucher tersedia

-

- Maaf, saat ini tidak ada voucher yang tersedia. -

-
-
- ) : ( + {loadingVoucher && listVouchers?.length > 0 && (

Promo Khusus Untuk {auth?.name}

@@ -1074,7 +1100,12 @@ const Checkout = () => {
{!!products && snakecaseKeys(products).map((item, index) => ( - + ))}
@@ -1137,7 +1168,7 @@ const Checkout = () => {
Diskon Voucher
- - {currencyFormat(discountVoucher)} + - {currencyFormat(cartCheckout?.discountVoucher)}
)} @@ -1365,7 +1396,12 @@ const Checkout = () => {
{!!products && snakecaseKeys(products).map((item, index) => ( - + ))}
@@ -1432,7 +1468,7 @@ const Checkout = () => {
Diskon Voucher
- - {currencyFormat(discountVoucher)} + - {currencyFormat(cartCheckout?.discountVoucher)}
)} @@ -1501,10 +1537,10 @@ const Checkout = () => { className='object-contain object-center h-6 w-full rounded-md' /> - {activeVoucher ? ( + {activeVoucher || activeVoucherShipping ? (
- Hemat {currencyFormat(discountVoucher)} + Hemat {currencyFormat(totalDiscountVoucher)}
Voucher berhasil digunakan -- cgit v1.2.3 From 6786d929b549d10ed1abc11f42d31af84d91bd38 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 28 Aug 2024 15:36:04 +0700 Subject: voucher --- src/lib/checkout/components/Checkout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 2e3d4e58..2d0f0f62 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -836,7 +836,7 @@ const Checkout = () => {
- {loadingVoucher && listVouchers?.length > 0 && ( + {!loadingVoucher && listVouchers?.length > 0 && (

Promo Khusus Untuk {auth?.name}

-- cgit v1.2.3 From 59327836c5e200e5eb474929f45e6e2a03eecfbe Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 28 Aug 2024 15:51:23 +0700 Subject: feedback renca --- src/lib/checkout/components/Checkout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 2d0f0f62..54acdf7c 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -701,7 +701,7 @@ const Checkout = () => { {listVoucherShippings && listVoucherShippings?.length > 0 && (
-

Promo Gratis Ongkir

+

Promo Extra Potongan Ongkir

{listVoucherShippings?.map((item) => (
Date: Thu, 29 Aug 2024 13:11:07 +0700 Subject: delete console log --- src/lib/checkout/api/getVoucher.js | 1 - 1 file changed, 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/api/getVoucher.js b/src/lib/checkout/api/getVoucher.js index ead4ffbe..779cef43 100644 --- a/src/lib/checkout/api/getVoucher.js +++ b/src/lib/checkout/api/getVoucher.js @@ -3,7 +3,6 @@ import { getAuth } from '@/core/utils/auth' export const getVoucher = async (id, query) => { const queryParam = new URLSearchParams(query); - console.log('ini params string',queryParam.toString()) const url = `/api/v1/user/${id}/voucher?${queryParam.toString()}`; const dataVoucher = await odooApi('GET', url); return dataVoucher; -- cgit v1.2.3 From 5c36cea8bccd9a9c06f61d82314af398afe0875f Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 3 Sep 2024 11:01:30 +0700 Subject: fixing feedback pak iwan (point 5) --- src/lib/checkout/components/Checkout.jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 54acdf7c..22265734 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -174,7 +174,6 @@ const Checkout = () => { } return; // Hentikan eksekusi lebih lanjut pada iterasi ini } - // Memeriksa apakah subtotal memenuhi syarat minimal pembelian if (cartCheckout?.subtotal < addNewLine.minPurchaseAmount) { SetSelisihHargaCode( @@ -191,7 +190,9 @@ const Checkout = () => { // Tambahkan voucher ke list dan set voucher aktif SetListVoucher((prevList) => [addNewLine, ...prevList]); - SetActiveVoucher(addNewLine.code); + if (addNewLine.canApply) { + SetActiveVoucher(addNewLine.code); + } } else { // Mencari voucher dalam listVoucherShippings let checkList = listVoucherShippings?.findIndex( @@ -227,7 +228,9 @@ const Checkout = () => { // Tambahkan voucher ke list pengiriman dan set voucher aktif pengiriman SetListVoucherShipping((prevList) => [addNewLine, ...prevList]); - setActiveVoucherShipping(addNewLine.code); + if (addNewLine.canApply) { + setActiveVoucherShipping(addNewLine.code); + } } }); @@ -701,7 +704,9 @@ const Checkout = () => { {listVoucherShippings && listVoucherShippings?.length > 0 && (
-

Promo Extra Potongan Ongkir

+

+ Promo Extra Potongan Ongkir +

{listVoucherShippings?.map((item) => (
Date: Tue, 3 Sep 2024 14:03:05 +0700 Subject: bug fix checout mobile --- src/lib/checkout/components/Checkout.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 22265734..f5975a99 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -1241,10 +1241,10 @@ const Checkout = () => { className='object-contain object-center h-6 rounded-md' /> - {activeVoucher ? ( + {activeVoucher || activeVoucherShipping ? (
- Potongan Senilai {currencyFormat(discountVoucher)} + Potongan Senilai {currencyFormat(totalDiscountVoucher)}
Voucher berhasil digunakan -- cgit v1.2.3 From 35850040a2e49d140d5ecf406dc1769e81badbf6 Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Tue, 3 Sep 2024 15:02:19 +0700 Subject: add link wa --- src/lib/checkout/components/Checkout.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index f5975a99..913bd273 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -1033,7 +1033,7 @@ const Checkout = () => {
Jika mengalami kesulitan dalam melakukan pembelian di website - Indoteknik. Hubungi kami disini + Indoteknik. Hubungi kami disini
-- cgit v1.2.3 From e07b4470ba487c01e2420a115a285e7fd4a305ce Mon Sep 17 00:00:00 2001 From: trisusilo48 Date: Wed, 4 Sep 2024 17:12:44 +0700 Subject: fixing voucher shipping --- src/lib/checkout/components/Checkout.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 913bd273..f63ef457 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -410,7 +410,7 @@ const Checkout = () => { Math.round(parseInt(finalShippingAmt * 1.1) / 1000) * 1000; const finalGT = GT < 0 ? 0 : GT; setGrandTotal(finalGT); - }, [biayaKirim, cartCheckout?.grandTotal, activeVoucher]); + }, [biayaKirim, cartCheckout?.grandTotal, activeVoucher, activeVoucherShipping]); const checkout = async () => { const file = poFile.current.files[0]; @@ -497,7 +497,7 @@ const Checkout = () => { } } - const midtrans = async () => { + /* const midtrans = async () => { for (const product of products) deleteItemCart({ productId: product.id }); if (grandTotal > 0) { const payment = await axios.post( @@ -513,7 +513,7 @@ const Checkout = () => { '-' )}`; } - }; + };*/ }; const handlingActivateCode = async () => { @@ -1189,7 +1189,7 @@ const Checkout = () => {
Biaya Kirim

{etdFix}

-
{currencyFormat(biayaKirim)}
+
{currencyFormat(Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000)}
{activeVoucherShipping && voucherShippingAmt && (
@@ -1490,7 +1490,7 @@ const Checkout = () => { Biaya Kirim

{etdFix}

-
{currencyFormat(biayaKirim)}
+
{currencyFormat(Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000) }
{activeVoucherShipping && voucherShippingAmt && (
-- cgit v1.2.3