diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index b747b34..d3cfec4 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -326,6 +326,7 @@ class CustomerController extends Controller 'status_order' => "Belum Bayar", 'email' => $biodataResult['email'], 'alamat' => $biodataResult['alamat'], + 'entry_at' => Carbon::now()->format('Y-m-d H:i:s.u'), ]; $order = Order::create($payloadOrder); foreach ($dataCart as $cart) { @@ -417,7 +418,6 @@ class CustomerController extends Controller ], 200); return back()->with('success', 'Bukti pembayaran berhasil diunggah.'); } catch (\Throwable $th) { - dd($th); DB::rollBack(); return response([ 'status' => false, @@ -438,6 +438,7 @@ class CustomerController extends Controller } public function checkOrder(){ + $payload = [ 'title' => 'Check Order' ]; diff --git a/public/asset_guests/css/main.css b/public/asset_guests/css/main.css index 29b569d..65f936e 100644 --- a/public/asset_guests/css/main.css +++ b/public/asset_guests/css/main.css @@ -1836,3 +1836,93 @@ section, flex-wrap: wrap; } } + + + /* =============== 375 PX FIX =============== */ +@media (max-width: 375px) { + + /* CARD */ + .col-6.col-xs-12 { + flex: 0 0 50%; + max-width: 50%; + } + + .card { + border-radius: 12px; + margin-bottom: .75rem; + } + + /* GAMBAR */ + .card img { + height: 120px !important; + } + + /* OVERLAY */ + .position-absolute[style*="height:50%"] { + height: 35% !important; + } + + /* NAMA */ + .position-absolute.bottom-0.start-0 h6 { + font-size: .75rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 100%; + margin-bottom: .1rem; + } + + /* BADGE KALORI, KATEGORI, SIANG/SORE */ + .position-absolute.bottom-0.start-0 .badge, + .position-absolute.bottom-0.end-0 .badge { + font-size: .5rem !important; + padding: .15rem .35rem; + max-width: 90%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + /* CHIP TANGGAL */ + .d-flex.gap-1.overflow-auto span { + font-size: .6rem !important; + padding: .15rem .35rem; + white-space: nowrap; + } + + /* HARGA */ + .row.text-muted.small { + font-size: .7rem !important; + } + + /* TOMBOL */ + .btn { + font-size: .60rem !important; /* ≈ 10 px */ + padding: .31rem .41rem !important; + border-radius: .25rem !important; + } + + + .d-flex.justify-content-between small { font-size: .65rem; } + .d-flex.justify-content-between strong { font-size: .65rem; } + +} + +/* fallback < 360 px menjadi 1 kolom */ +@media (max-width: 359px) { + .col-6.col-xs-12 { + flex: 0 0 100%; + max-width: 100%; + } + + @media (max-width: 340px) { + .d-flex.p-2 { flex-direction: column; gap: .5rem; } + .btn { width: 100% !important; font-size: .7rem; padding: .35rem 0; } + } +} + +#floatingCartButton:hover, +#menuBtn:hover { + transform: translateX(-50%) translateY(-2px); + transition: transform .25s; +} \ No newline at end of file diff --git a/public/js/checkout/action.js b/public/js/checkout/action.js index a4f1f0a..7d6c1d4 100644 --- a/public/js/checkout/action.js +++ b/public/js/checkout/action.js @@ -122,7 +122,7 @@ async function submitOrderToServer(){ confirmButtonText: 'Tutup!' }).then(() => { window.location.href = "/"; - });; + }); } } catch (err) { sessionStorage.removeItem('cart'); diff --git a/public/js/order_guest/checkout.js b/public/js/order_guest/checkout.js index e29a163..e253792 100644 --- a/public/js/order_guest/checkout.js +++ b/public/js/order_guest/checkout.js @@ -31,6 +31,7 @@ let orderIndex = 0; function renderCartList() { $("#cartSidebar").offcanvas('show') $('#floatingCartButton').addClass('d-none'); + $('#menuBtn').addClass('d-none'); const cart = JSON.parse(sessionStorage.getItem('cart') || '[]'); let total = 0; @@ -129,6 +130,7 @@ let orderIndex = 0; if (cart.length > 0) { $('#floatingCartButton').removeClass('d-none'); + $('#menuBtn').removeClass('d-none'); $('#floatingCartCount').text(totalItem); $('#floatingCartTotal').text('Rp ' + totalHarga.toLocaleString('id-ID')); $('#floatingCartDesc').text(`Total pesanan dari ${cart[0].nama_menu}`); diff --git a/public/js/order_guest/index.js b/public/js/order_guest/index.js index 9839aea..ceb3b30 100644 --- a/public/js/order_guest/index.js +++ b/public/js/order_guest/index.js @@ -2,6 +2,7 @@ const cart = JSON.parse(sessionStorage.getItem('cart') || '[]'); if (cart.length > 0) { $('#floatingCartButton').removeClass('d-none'); + $('#menuBtn').removeClass('d-none'); } }); @@ -100,85 +101,95 @@ menus?.forEach(menu => { html += ` -
-
-
-
- Keranjang kosong
'; + if (cart.length === 0) { + document.getElementById('cartList').classList.add('d-none'); + } + } + + function removeItem(index) { + const cart = JSON.parse(sessionStorage.getItem('cart') || '[]'); + cart.splice(index, 1); + sessionStorage.setItem('cart', JSON.stringify(cart)); + renderCart(cart); + updateCartCount(cart.length); + } + + function closeOnOutside(e) { + const list = document.getElementById('cartList'); + const removeButton = e.target.closest('button[onclick^="removeItem"]') + if (!list.contains(e.target) && !document.getElementById('menuBtn').contains(e.target) && !removeButton) { + list.classList.add('d-none'); + } + } + + diff --git a/resources/views/guest/index.blade.php b/resources/views/guest/index.blade.php index 11197cb..f9d15c1 100644 --- a/resources/views/guest/index.blade.php +++ b/resources/views/guest/index.blade.php @@ -58,36 +58,63 @@ Menampilkan menu...