diff --git a/public/js/checkout/index.js b/public/js/checkout/index.js index f1f4904..b83b4ae 100644 --- a/public/js/checkout/index.js +++ b/public/js/checkout/index.js @@ -745,23 +745,45 @@ function hitungTotalHarga(){ } -function copyNoRek() { - const text = document.getElementById('noRekText').innerText; - navigator.clipboard.writeText(text).then(() => { - alert("Nomor rekening berhasil disalin: " + text); - }).catch(err => { - console.error('Gagal menyalin: ', err); - alert("Gagal menyalin teks."); - }); -} + function copyNoRek() { + const text = document.getElementById('noRekText').innerText; + navigator.clipboard.writeText(text).then(() => { + Swal.fire({ + icon: 'success', + title: 'Disalin!', + text: 'Nomor rekening berhasil disalin: ' + text, + showConfirmButton: false, + timer: 1500 + }); + }).catch(err => { + console.error('Gagal menyalin: ', err); + Swal.fire({ + icon: 'warning', + text: 'Gagal menyalin teks: ' + text, + showConfirmButton: false, + timer: 2000 + }); + }); + } function copyNoOrder() { const text = document.getElementById('no_order_display').innerText; navigator.clipboard.writeText(text).then(() => { - alert("Nomor order berhasil disalin: " + text); + Swal.fire({ + icon: 'success', + title: 'Disalin!', + text: 'Nomor order berhasil disalin: ' + text, + showConfirmButton: false, + timer: 1500 + }); }).catch(err => { console.error('Gagal menyalin: ', err); - alert("Gagal menyalin teks."); + Swal.fire({ + icon: 'warning', + text: 'Gagal menyalin teks: ' + text, + showConfirmButton: false, + timer: 2000 + }); }); } diff --git a/resources/views/guest/success_page.blade.php b/resources/views/guest/success_page.blade.php index 755cd36..4d894fa 100644 --- a/resources/views/guest/success_page.blade.php +++ b/resources/views/guest/success_page.blade.php @@ -10,7 +10,7 @@

Terima kasih atas pesanan Anda. Kami akan segera menyiapkannya dan menghubungi Anda jika diperlukan.


Simpan Nomor Order Anda untuk memantau status pesanan secara berkala. Hubungi kami jika ada pertanyaan.

-

No Order : {{ $no_order }} +

No Order : {{ $no_order }} @@ -27,10 +27,21 @@ function copyNoOrder() { const text = document.getElementById('noOrderText').innerText; navigator.clipboard.writeText(text).then(() => { - alert("Nomor order berhasil disalin: " + text); + Swal.fire({ + icon: 'success', + title: 'Disalin!', + text: 'Nomor order berhasil disalin: ' + text, + showConfirmButton: false, + timer: 1500 + }); }).catch(err => { console.error('Gagal menyalin: ', err); - alert("Gagal menyalin teks."); + Swal.fire({ + icon: 'warning', + text: 'Gagal menyalin teks: ' + text, + showConfirmButton: false, + timer: 2000 + }); }); }