@php $cart = session('menu_cart', []); $cartCount = array_sum(array_column($cart, 'quantity')); $qrCode = session('menu_qr_code'); // Tip B için $customerQrId = session('menu_customer_qr_id'); // Tip C için $menuType = session('menu_type'); $currentRoute = request()->route()->getName(); // Determine the correct menu link based on menu type if ($menuType === 'customer_qr' && $customerQrId) { // Type C: Get QR code from database $customerQr = \App\Models\CustomerQrCode::find($customerQrId); $menuLink = $customerQr ? route('menu.customer-qr', ['qr_code' => $customerQr->qr_code]) : route('menu.index'); } else { // Type B or default: Use fixed QR code $menuLink = $qrCode ? route('menu.index', $qrCode) : route('menu.index'); } // Adisyon ürün sayısı $adisyonCount = 0; $saleId = session('menu_sale_id'); if ($saleId) { $adisyonCount = \App\Models\Order::where('sale_id', $saleId)->sum('quantity'); } @endphp
MENÜ SEPET {{ $cartCount }} SİPARİŞLERİM {{ number_format($adisyonCount, 0) }}