@extends('layouts.master') @section('title', 'Your Basket') @section('style') @endsection @section('content') @php // Get the currently logged-in user $user = auth()->user(); if ($user) { $cartItems = $user->cart; $totalItems = 0; $totalPrice = 0.0; $totalWeight = 0.0; foreach ($cartItems as $cartItem) { $itemData = json_decode($cartItem->item); $totalItems += $itemData->totalQty; $totalPrice += $itemData->totalPrice; $totalWeight += $itemData->totalWeight; } } @endphp

Your Basket {{count(auth()->user()->cart) < 1 ? "is Empty" : ""}}

@if(count(auth()->user()->cart) > 0)
@foreach ($cartItems as $cartItem) @php $itemData = json_decode($cartItem->item); $courierServiceData = getCourierServiceData($itemData->service->service_id, true); @endphp
@if(isset($cartItem->message))
{{ $cartItem->message }}323
@endif
Courier Image {{ $itemData->service->Name }}
{{ $itemData->shipment->ship_from->postcode1 }}
@if(isset($courierServiceData['start_date']))
{{ $courierServiceData['exp_lead_time'] }} Delivery
@endif
{{ $itemData->shipment->ship_to->postcode }}

Items: {{ $itemData->totalQty }}

Weight: {{ $itemData->totalWeight }}

Total: £ {{ $itemData->totalPrice }}

@endforeach
Order Summary
Items:
{{ $totalItems }}
Weight:
{{ $totalWeight }}
Total:
£ {{ $totalPrice }}
Payment Options

OR

@if(auth()->user()->hasPermissionTo('noPay'))

OR

@role('Administrator')
@endrole @endif
@endif
@endsection @section('script') @endsection