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/components') 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/components') 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/components') 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/components') 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