From 07138ddc724233f688de9c16de59c1b61b885520 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 1 Mar 2024 16:59:35 +0700 Subject: create component address dan expedisi --- src/lib/checkout/components/CheckoutSection.jsx | 207 ++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 src/lib/checkout/components/CheckoutSection.jsx (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/CheckoutSection.jsx b/src/lib/checkout/components/CheckoutSection.jsx new file mode 100644 index 00000000..34fe19f7 --- /dev/null +++ b/src/lib/checkout/components/CheckoutSection.jsx @@ -0,0 +1,207 @@ +import Link from "next/link"; +import BottomPopup from '@/core/components/elements/Popup/BottomPopup'; +import { AnimatePresence, motion } from "framer-motion"; +import { Divider, Spinner } from "@chakra-ui/react"; + +export const SectionAddress = ({ address, label, url }) => { + return ( +
+
+
{label}
+ + Pilih Alamat Lain + +
+ + {address && ( +
+
+ {address.type.charAt(0).toUpperCase() + + address.type.slice(1) + + ' Address'} +
+

{address.name}

+

{address.mobile}

+

+ {address.street}, {address?.city?.name} +

+
+ )} +
+ ) +} + +export const SectionValidation = ({ address }) => + address?.rajaongkirCityId == 0 && ( + +
+ Mohon untuk memperbarui alamat Anda dengan mengklik tombol di bawah ini.{' '} +
+
+ + Update Alamat + +
+
+ ); + +export const SectionExpedisi = ({ + address, + listExpedisi, + setSelectedExpedisi, + checkWeigth, + checkoutValidation, + expedisiValidation, + loadingRajaOngkir, +}) => + address?.rajaongkirCityId > 0 && ( +
+
+
Pilih Ekspedisi:
+
+
+ + + + {loadingRajaOngkir && ( + + + + )} + +
+ {checkoutValidation && ( + + *silahkan pilih expedisi + + )} +
+ +
+ {checkWeigth == true && ( +

+ Mohon maaf, pengiriman hanya tersedia untuk self pickup karena + terdapat barang yang belum diatur beratnya. Mohon atur berat barang + dengan menghubungi admin melalui{' '} + + tautan ini + +

+ )} +
+ ); + +export const SectionListService = ({ listserviceExpedisi, setSelectedServiceType }) => + listserviceExpedisi?.length > 0 && ( + <> +
+
+
Tipe Layanan Ekspedisi:
+
+ +
+
+
+ + + ); + + export const PickupAddress = ({ label }) => ( +
+
+
{label}
+
+
+

Indoteknik

+

+ Jl. Bandengan Utara Raya No.85, RT.3/RW.16, Penjaringan, Kec. + Penjaringan, Kota Jkt Utara, Daerah Khusus Ibukota Jakarta, Indonesia + Kodepos : 14440 +

+

Telp : 021-2933 8828/29

+

Mobile : 0813 9000 7430

+
+
+ ); + + const extractDuration = (text) => { + const matches = text.match(/\d+(?:-\d+)?/g); + + if (matches && matches.length === 1) { + const parts = matches[0].split('-'); + const min = parseInt(parts[0]); + const max = parseInt(parts[1]); + + if (min === max) { + return min.toString(); + } + + return matches[0]; + } + + return ''; + }; + \ No newline at end of file -- cgit v1.2.3 From 39b5e05a5fcc7ca26342f37e85c6585d1dacb3a5 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 5 Mar 2024 14:37:44 +0700 Subject: add address & expedisi di page quotation - template stepper approval --- src/lib/checkout/components/CheckoutSection.jsx | 174 +++++++++++++++--------- 1 file changed, 112 insertions(+), 62 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/CheckoutSection.jsx b/src/lib/checkout/components/CheckoutSection.jsx index 34fe19f7..7f9ea08a 100644 --- a/src/lib/checkout/components/CheckoutSection.jsx +++ b/src/lib/checkout/components/CheckoutSection.jsx @@ -1,35 +1,35 @@ -import Link from "next/link"; +import Link from 'next/link'; import BottomPopup from '@/core/components/elements/Popup/BottomPopup'; -import { AnimatePresence, motion } from "framer-motion"; -import { Divider, Spinner } from "@chakra-ui/react"; +import { AnimatePresence, motion } from 'framer-motion'; +import { Divider, Spinner } from '@chakra-ui/react'; export const SectionAddress = ({ address, label, url }) => { - return ( -
-
-
{label}
- - Pilih Alamat Lain - -
- - {address && ( -
-
- {address.type.charAt(0).toUpperCase() + - address.type.slice(1) + - ' Address'} -
-

{address.name}

-

{address.mobile}

-

- {address.street}, {address?.city?.name} -

-
- )} + return ( +
+
+
{label}
+ + Pilih Alamat Lain +
- ) -} + + {address && ( +
+
+ {address.type.charAt(0).toUpperCase() + + address.type.slice(1) + + ' Address'} +
+

{address.name}

+

{address.mobile}

+

+ {address.street}, {address?.city?.name} +

+
+ )} +
+ ); +}; export const SectionValidation = ({ address }) => address?.rajaongkirCityId == 0 && ( @@ -129,7 +129,10 @@ export const SectionExpedisi = ({
); -export const SectionListService = ({ listserviceExpedisi, setSelectedServiceType }) => +export const SectionListService = ({ + listserviceExpedisi, + setSelectedServiceType, +}) => listserviceExpedisi?.length > 0 && ( <>
@@ -169,39 +172,86 @@ export const SectionListService = ({ listserviceExpedisi, setSelectedServiceType ); - export const PickupAddress = ({ label }) => ( -
-
-
{label}
-
-
-

Indoteknik

-

- Jl. Bandengan Utara Raya No.85, RT.3/RW.16, Penjaringan, Kec. - Penjaringan, Kota Jkt Utara, Daerah Khusus Ibukota Jakarta, Indonesia - Kodepos : 14440 -

-

Telp : 021-2933 8828/29

-

Mobile : 0813 9000 7430

-
+export const PickupAddress = ({ label }) => ( +
+
+
{label}
- ); +
+

Indoteknik

+

+ Jl. Bandengan Utara Raya No.85, RT.3/RW.16, Penjaringan, Kec. + Penjaringan, Kota Jkt Utara, Daerah Khusus Ibukota Jakarta, Indonesia + Kodepos : 14440 +

+

Telp : 021-2933 8828/29

+

Mobile : 0813 9000 7430

+
+
+); + +const extractDuration = (text) => { + const matches = text.match(/\d+(?:-\d+)?/g); - const extractDuration = (text) => { - const matches = text.match(/\d+(?:-\d+)?/g); - - if (matches && matches.length === 1) { - const parts = matches[0].split('-'); - const min = parseInt(parts[0]); - const max = parseInt(parts[1]); - - if (min === max) { - return min.toString(); - } - - return matches[0]; + if (matches && matches.length === 1) { + const parts = matches[0].split('-'); + const min = parseInt(parts[0]); + const max = parseInt(parts[1]); + + if (min === max) { + return min.toString(); } - - return ''; - }; - \ No newline at end of file + + return matches[0]; + } + + return ''; +}; + +export function calculateEstimatedArrival(duration) { + if (duration) { + let estimationDate = duration.split('-'); + estimationDate[0] = parseInt(estimationDate[0]); + estimationDate[1] = parseInt(estimationDate[1]); + const from = addDays(new Date(), estimationDate[0] + 3); + const to = addDays(new Date(), estimationDate[1] + 3); + + let etdText = `*Estimasi tiba ${formatDate(from)}`; + + if (estimationDate[1] > estimationDate[0]) { + etdText += ` - ${formatDate(to)}`; + } + + return etdText; + } + + return ''; +} + +function addDays(date, days) { + const result = new Date(date); + result.setDate(result.getDate() + days); + return result; +} + +function formatDate(date) { + const day = date.getDate(); + const month = date.toLocaleString('default', { month: 'short' }); + return `${day} ${month}`; +} + +export function splitDuration(duration) { + if (duration) { + let estimationDate = null; + if (duration.includes('-')) { + estimationDate = duration.split('-'); + estimationDate = parseInt(estimationDate[1]); + } else { + estimationDate = parseInt(duration); + } + + return estimationDate; + } + + return ''; +} \ No newline at end of file -- cgit v1.2.3 From c8cb137354ec569b4a13e180bc9cac2cab90c470 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Sat, 6 Apr 2024 12:31:45 +0700 Subject: add voucher minus --- src/lib/checkout/components/Checkout.jsx | 38 +++++++++++++++++--------- src/lib/checkout/email/FinishCheckoutEmail.jsx | 4 +-- 2 files changed, 27 insertions(+), 15 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 52edbd05..7a456d70 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -111,6 +111,7 @@ const Checkout = () => { const [checkoutValidation, setCheckoutValidation] = useState(false); const [loadingVoucher, setLoadingVoucher] = useState(true); const [loadingRajaOngkir, setLoadingRajaOngkir] = useState(false); + const [grandTotal, setGrandTotal] = useState(0); const expedisiValidation = useRef(null); @@ -295,6 +296,14 @@ const Checkout = () => { const [isLoading, setIsLoading] = useState(false); + useEffect(() => { + const GT = + cartCheckout?.grandTotal + + Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000; + const finalGT = GT < 0 ? 0 : GT; + setGrandTotal(finalGT); + }, [biayaKirim, cartCheckout?.grandTotal, activeVoucher]); + const checkout = async () => { const file = poFile.current.files[0]; if (typeof file !== 'undefined' && file.size > 5000000) { @@ -352,11 +361,20 @@ const Checkout = () => { const midtrans = async () => { for (const product of products) deleteItemCart({ productId: product.id }); - 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; + 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, + '-' + )}`; + } }; gtag('event', 'conversion', { @@ -913,10 +931,7 @@ const Checkout = () => {
Grand Total
- {currencyFormat( - cartCheckout?.grandTotal + - Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000 - )} + {currencyFormat(grandTotal)}
)} @@ -1208,10 +1223,7 @@ const Checkout = () => {
Grand Total
- {currencyFormat( - cartCheckout?.grandTotal + - Math.round(parseInt(biayaKirim * 1.1) / 1000) * 1000 - )} + {currencyFormat(grandTotal)}
)} diff --git a/src/lib/checkout/email/FinishCheckoutEmail.jsx b/src/lib/checkout/email/FinishCheckoutEmail.jsx index d40ce7d4..23e7f877 100644 --- a/src/lib/checkout/email/FinishCheckoutEmail.jsx +++ b/src/lib/checkout/email/FinishCheckoutEmail.jsx @@ -91,7 +91,7 @@ const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { menyelesaikan transaksi dengan detail dibawah ini:
  • Nomor Pembelian: {transaction.name}
  • -
  • Nominal: {currencyFormat(transaction.amountTotal)}
  • +
  • Nominal: {transaction.amountTotal > 0 ? currencyFormat(transaction.amountTotal) : '0'}
  • Tanggal: {transaction.dateOrder}
@@ -213,7 +213,7 @@ const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { Grand Total - {currencyFormat(transaction.amountTotal)} + {transaction.amountTotal > 0 ? currencyFormat(transaction.amountTotal) : '0'} -- cgit v1.2.3 From 28dc5e42b92b55ff14dc5fa94e49d5bd69d4951a Mon Sep 17 00:00:00 2001 From: "tri.susilo" Date: Tue, 23 Apr 2024 17:00:56 +0700 Subject: mengganti body email, ketika total amount <= 0 --- src/lib/checkout/email/FinishCheckoutEmail.jsx | 371 +++++++++++++------------ 1 file changed, 189 insertions(+), 182 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/email/FinishCheckoutEmail.jsx b/src/lib/checkout/email/FinishCheckoutEmail.jsx index 23e7f877..21941cd5 100644 --- a/src/lib/checkout/email/FinishCheckoutEmail.jsx +++ b/src/lib/checkout/email/FinishCheckoutEmail.jsx @@ -14,6 +14,7 @@ import { Section, Text } from '@react-email/components' +import FinishCheckout from '../components/FinishCheckout' const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { return ( @@ -38,7 +39,10 @@ const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { Hai {transaction.address.customer.name}, - + + {transaction.amountTotal > 0 ? +
+ {statusPayment == 'success' && ( <> Terima kasih atas kepercayaan anda berbelanja di Indoteknik. Dengan ini kami @@ -71,202 +75,205 @@ const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { & Solution )} - - - {['pending', 'failed'].includes(statusPayment) && ( - <> - Jika anda mengalami kesulitan, dapat menghubungi Customer Service kami untuk - menanyakan transaksi anda lakukan melalui Whatsapp kami. - - )} - {statusPayment == 'success' && ( - <> - Anda dapat menghubungi Customer Service kami untuk menanyakan status pesanan yang - sudah berhasil anda lakukan melalui Whatsapp kami. - - )} - {statusPayment == 'manual' && ( + + + {['pending', 'failed'].includes(statusPayment) && ( + <> + Jika anda mengalami kesulitan, dapat menghubungi Customer Service kami untuk + menanyakan transaksi anda lakukan melalui Whatsapp kami. + + )} + {statusPayment == 'success' && ( + <> + Anda dapat menghubungi Customer Service kami untuk menanyakan status pesanan yang + sudah berhasil anda lakukan melalui Whatsapp kami. + + )} + {statusPayment == 'manual' && ( + <> + Kami mohon kepada {transaction.address.customer.name} untuk dapat segera + menyelesaikan transaksi dengan detail dibawah ini: +
    +
  • Nomor Pembelian: {transaction.name}
  • +
  • Nominal: {currencyFormat(transaction.amountTotal)}
  • +
  • Tanggal: {transaction.dateOrder}
  • +
+ + )} +
+ + {['pending', 'failed', 'success'].includes(statusPayment) && ( <> - Kami mohon kepada {transaction.address.customer.name} untuk dapat segera - menyelesaikan transaksi dengan detail dibawah ini: -
    -
  • Nomor Pembelian: {transaction.name}
  • -
  • Nominal: {transaction.amountTotal > 0 ? currencyFormat(transaction.amountTotal) : '0'}
  • -
  • Tanggal: {transaction.dateOrder}
  • -
- - )} - + + Detail Transaksi + - {['pending', 'failed', 'success'].includes(statusPayment) && ( - <> - - Detail Transaksi - +
-
+
+ {statusPayment == 'success' && + 'Struk ini dapat anda simpan sebagai bukti tambahan dalam transaksi yang telah dilakukan.'} + {statusPayment == 'pending' && + 'Kami akan menginformasikan melalui email setelah anda berhasil melakukan pembayaran.'} + {statusPayment == 'failed' && + 'Dimohon untuk tidak melakukan pembayaran. Karena transaksi anda tidak berhasil dibuat.'} +
-
- {statusPayment == 'success' && - 'Struk ini dapat anda simpan sebagai bukti tambahan dalam transaksi yang telah dilakukan.'} - {statusPayment == 'pending' && - 'Kami akan menginformasikan melalui email setelah anda berhasil melakukan pembayaran.'} - {statusPayment == 'failed' && - 'Dimohon untuk tidak melakukan pembayaran. Karena transaksi anda tidak berhasil dibuat.'} -
+ + No Transaksi (SO) + {transaction.name} + + + Tanggal Transaksi + {payment.transactionTime} + + + Status Pembayaran + + {statusPayment == 'success' && ( +
Berhasil
+ )} + {statusPayment == 'pending' && ( +
Pending
+ )} + {statusPayment == 'failed' && ( +
Tidak Berhasil
+ )} +
+
+ + Metode Pembayaran + + {toTitleCase(payment.paymentType.replaceAll('_', ' '))} + + + + Batas Akhir Pembayaran + {payment.expiryTime} + + + Nominal Transfer + + {currencyFormat(payment.grossAmount)} + + - - No Transaksi (SO) - {transaction.name} - - - Tanggal Transaksi - {payment.transactionTime} - - - Status Pembayaran - - {statusPayment == 'success' && ( -
Berhasil
- )} - {statusPayment == 'pending' && ( -
Pending
- )} - {statusPayment == 'failed' && ( -
Tidak Berhasil
- )} -
-
- - Metode Pembayaran - - {toTitleCase(payment.paymentType.replaceAll('_', ' '))} - - - - Batas Akhir Pembayaran - {payment.expiryTime} - - - Nominal Transfer - - {currencyFormat(payment.grossAmount)} - - + + Detail Produk + - - Detail Produk - +
-
+ {transaction.products.map((product) => ( + + + + + + {product.name} + {product.code} +
+ + {currencyFormat(product.price.priceDiscount)} + + {product.price.discountPercentage > 0 && ( + <> +   + + {currencyFormat(product.price.price)} + + + )} +   x {product.quantity} barang +
+
+
+ ))} - {transaction.products.map((product) => ( - - - +
+ + + Subtotal + + {currencyFormat(transaction.subtotal)} - - {product.name} - {product.code} -
- - {currencyFormat(product.price.priceDiscount)} - - {product.price.discountPercentage > 0 && ( - <> -   - - {currencyFormat(product.price.price)} - - - )} -   x {product.quantity} barang -
+
+ + Total Diskon + + {currencyFormat(transaction.discountTotal)} + + + + PPN 11% (Incl.) + + {currencyFormat(transaction.subtotal * 0.11)} - ))} - -
- - - Subtotal - - {currencyFormat(transaction.subtotal)} - - - - Total Diskon - - {currencyFormat(transaction.discountTotal)} - - - - PPN 11% (Incl.) - - {currencyFormat(transaction.subtotal * 0.11)} - - - -
- - Grand Total - - - {transaction.amountTotal > 0 ? currencyFormat(transaction.amountTotal) : '0'} - - - +
-
- - )} + + Grand Total + + + {transaction.amountTotal > 0 ? currencyFormat(transaction.amountTotal) : '0'} + + + - {statusPayment == 'manual' && ( - <> - - Dengan cara dibawah ini: -
    -
  • - Lakukan pembayaran manual via mobile app perbankan{' '} - {transaction.address.customer.name} -
    - Nama Bank: Bank Central Asia (BCA) -
    - No. Rek: 8870400081 -
    - A/N: INDOTEKNIK DOTCOM GEMILANG PT -
  • -
  • - Setelah berhasil melakukan pembayaran, mohon agar melakukan Screen Capture bukti - bayar sebagai bukti untuk kami bahwa {transaction.address.customer.name} telah - melakukan transaksi pembayaran -
  • -
  • - Kirimkan bukti transaksi pembayaran anda dengan melakukan reply / balas email - ini dengan melampirkan bukti di attachment / lampiran -
  • -
  • - Transaksi {transaction.address.customer.name} akan segera diproses oleh salah - satu Account Representative Indoteknik -
  • -
-
- - Jika ada pertanyaan seputar teknis pembayaran {transaction.address.customer.name}{' '} - dapat hubungi kami melalui Email{' '} - (sales@indoteknik.com) atau Whatsapp{' '} - - (+62 812-8080-622) - - . - - - Terima kasih atas perhatiannya, selamat kembali beraktifitas - - - )} +
+ + )} + {statusPayment == 'manual' && ( + <> + + Dengan cara dibawah ini: +
    +
  • + Lakukan pembayaran manual via mobile app perbankan{' '} + {transaction.address.customer.name} +
    + Nama Bank: Bank Central Asia (BCA) +
    + No. Rek: 8870400081 +
    + A/N: INDOTEKNIK DOTCOM GEMILANG PT +
  • +
  • + Setelah berhasil melakukan pembayaran, mohon agar melakukan Screen Capture bukti + bayar sebagai bukti untuk kami bahwa {transaction.address.customer.name} telah + melakukan transaksi pembayaran +
  • +
  • + Kirimkan bukti transaksi pembayaran anda dengan melakukan reply / balas email + ini dengan melampirkan bukti di attachment / lampiran +
  • +
  • + Transaksi {transaction.address.customer.name} akan segera diproses oleh salah + satu Account Representative Indoteknik +
  • +
+
+ + Jika ada pertanyaan seputar teknis pembayaran {transaction.address.customer.name}{' '} + dapat hubungi kami melalui Email{' '} + (sales@indoteknik.com) atau Whatsapp{' '} + + (+62 812-8080-622) + + . + + + Terima kasih atas perhatiannya, selamat kembali beraktifitas + + + )} +
+ : + } + Best regards, -- cgit v1.2.3 From 54409d9079d80f216cb0c6e6fc1620a84743d52f Mon Sep 17 00:00:00 2001 From: "tri.susilo" Date: Wed, 24 Apr 2024 10:13:24 +0700 Subject: manggil nomor transaksi --- src/lib/checkout/email/FinishCheckoutEmail.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/email/FinishCheckoutEmail.jsx b/src/lib/checkout/email/FinishCheckoutEmail.jsx index 21941cd5..9cf669c3 100644 --- a/src/lib/checkout/email/FinishCheckoutEmail.jsx +++ b/src/lib/checkout/email/FinishCheckoutEmail.jsx @@ -17,6 +17,8 @@ import { import FinishCheckout from '../components/FinishCheckout' const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { + console.log("Transaction : ",transaction); + return ( @@ -271,9 +273,8 @@ const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { )}
- : + : } - Best regards, -- cgit v1.2.3 From a038a7d14eaa72b27ece9448c174665b2344d5f0 Mon Sep 17 00:00:00 2001 From: "tri.susilo" Date: Wed, 24 Apr 2024 10:24:36 +0700 Subject: hapus console log --- src/lib/checkout/email/FinishCheckoutEmail.jsx | 1 - 1 file changed, 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/email/FinishCheckoutEmail.jsx b/src/lib/checkout/email/FinishCheckoutEmail.jsx index 9cf669c3..d19ba1ca 100644 --- a/src/lib/checkout/email/FinishCheckoutEmail.jsx +++ b/src/lib/checkout/email/FinishCheckoutEmail.jsx @@ -17,7 +17,6 @@ import { import FinishCheckout from '../components/FinishCheckout' const FinishCheckoutEmail = ({ transaction, payment, statusPayment }) => { - console.log("Transaction : ",transaction); return ( -- cgit v1.2.3 From 1bb3f91f27db4db6a16a1ed3fe59016268ba3d44 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 8 May 2024 13:23:10 +0700 Subject: change wa number --- src/lib/checkout/components/Checkout.jsx | 2 +- src/lib/checkout/components/CheckoutOld.jsx | 2 +- src/lib/checkout/components/CheckoutSection.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 7a456d70..0090acee 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -1454,7 +1454,7 @@ const SectionExpedisi = ({ dengan menghubungi admin melalui{' '} tautan ini diff --git a/src/lib/checkout/components/CheckoutOld.jsx b/src/lib/checkout/components/CheckoutOld.jsx index d57fbd66..e2c45ce6 100644 --- a/src/lib/checkout/components/CheckoutOld.jsx +++ b/src/lib/checkout/components/CheckoutOld.jsx @@ -696,7 +696,7 @@ const SectionExpedisi = ({ address, listExpedisi, setSelectedExpedisi, checkWeig diatur beratnya. Mohon atur berat barang dengan menghubungi admin melalui{' '} tautan ini diff --git a/src/lib/checkout/components/CheckoutSection.jsx b/src/lib/checkout/components/CheckoutSection.jsx index 7f9ea08a..affe6138 100644 --- a/src/lib/checkout/components/CheckoutSection.jsx +++ b/src/lib/checkout/components/CheckoutSection.jsx @@ -120,7 +120,7 @@ export const SectionExpedisi = ({ dengan menghubungi admin melalui{' '} tautan ini -- cgit v1.2.3 From da80b7e00e2ee6aaa3a81902cd51ff556d4d7ef0 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Wed, 5 Jun 2024 15:01:12 +0700 Subject: fixing shipping address and invoice address --- src/lib/checkout/components/Checkout.jsx | 6 ++++-- 1 file changed, 4 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 0090acee..5ca3611f 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -333,8 +333,10 @@ const Checkout = () => { quantity: product.quantity, })); let data = { - partner_shipping_id: auth.partnerId, - partner_invoice_id: auth.partnerId, + // partner_shipping_id: auth.partnerId, + // partner_invoice_id: auth.partnerId, + partner_shipping_id: selectedAddress?.shipping?.id || auth.partnerId, + partner_invoice_id: selectedAddress?.invoicing?.id || auth.partnerId, user_id: auth.id, order_line: JSON.stringify(productOrder), delivery_amount: biayaKirim, -- cgit v1.2.3 From b992edcc7f1b7395dea0c8562ddf272df9fc6b7f Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Sat, 29 Jun 2024 10:08:16 +0700 Subject: add parameter flag flash sale --- src/lib/checkout/components/Checkout.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/checkout') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 5ca3611f..df1768fb 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -112,6 +112,7 @@ const Checkout = () => { const [loadingVoucher, setLoadingVoucher] = useState(true); const [loadingRajaOngkir, setLoadingRajaOngkir] = useState(false); const [grandTotal, setGrandTotal] = useState(0); + const [hasFlashSale, setHasFlashSale] = useState(false); const expedisiValidation = useRef(null); @@ -224,6 +225,7 @@ const Checkout = () => { setProducts(cartCheckout?.products); setCheckWeight(cartCheckout?.hasProductWithoutWeight); setTotalWeight(cartCheckout?.totalWeight.g); + setHasFlashSale(cartCheckout?.products[0]?.hasFlashsale ? cartCheckout.products[0].hasFlashsale : false); }, [cartCheckout]); useEffect(() => { @@ -343,6 +345,7 @@ const Checkout = () => { carrier_id: selectedCarrierId, estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, + flash_sale : !hasFlashSale, // dibuat negasi untuk ngetest kebalikan nilai false voucher: activeVoucher, type: 'sale_order', }; @@ -358,7 +361,7 @@ const Checkout = () => { toast.error('Gagal melakukan transaksi, terjadi kesalahan internal'); return; } - + console.log("isCheckouted",isCheckouted) gtagPurchase(products, biayaKirim, isCheckouted.name); const midtrans = async () => { -- cgit v1.2.3 From 703136862dc3d41d0a276c17fa7f4ecebd471527 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 1 Jul 2024 09:07:59 +0700 Subject: add flash sales to sales order --- src/lib/checkout/components/Checkout.jsx | 5 +++-- 1 file changed, 3 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 df1768fb..4aafdece 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -227,6 +227,7 @@ const Checkout = () => { setTotalWeight(cartCheckout?.totalWeight.g); setHasFlashSale(cartCheckout?.products[0]?.hasFlashsale ? cartCheckout.products[0].hasFlashsale : false); }, [cartCheckout]); + useEffect(() => { setCheckoutValidation(false); @@ -345,7 +346,7 @@ const Checkout = () => { carrier_id: selectedCarrierId, estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, - flash_sale : !hasFlashSale, // dibuat negasi untuk ngetest kebalikan nilai false + flash_sale : hasFlashSale, // dibuat negasi untuk ngetest kebalikan nilai false voucher: activeVoucher, type: 'sale_order', }; @@ -361,7 +362,7 @@ const Checkout = () => { toast.error('Gagal melakukan transaksi, terjadi kesalahan internal'); return; } - console.log("isCheckouted",isCheckouted) + gtagPurchase(products, biayaKirim, isCheckouted.name); const midtrans = async () => { -- cgit v1.2.3