@extends('layouts.app', ['isCart' => TRUE]) @section('css_after') @endsection @section('content')
@php //dd(App\Http\Controllers\ShoppingCartController::getCartByDeliveryDate()); $now = \Carbon\Carbon::now(); if($now->format('l') !== "Tuesday") $now = \Carbon\Carbon::parse('next tuesday'); @endphp

Your Cart

@if(session('success'))
@endif @if ($errors->any())
@endif @if(session('message'))
@endif
@foreach(App\Http\Controllers\ShoppingCartController::getCartByDeliveryDate() as $deliveryDay => $items) @foreach($items as $cartItem) @php if($cartItem->associatedModel == "App\Order") continue; @endphp @if($cartItem->associatedModel == \App\Product::class) @php $product = $cartItem->model; @endphp @endif @if($cartItem->associatedModel == "App\DiscountCode") @endif @endforeach @endforeach
    Product Price Quantity Subtotal
× {{ $cartItem->name }} £{{ number_format($cartItem->price, 2) }} £{{ number_format($cartItem->total, 2) }}
Discount Applied
{{ $cartItem->name }}
£{{ number_format($cartItem->price, 2) }} £{{ number_format($cartItem->total, 2) }}
@guest Checkout @else Continue to Payment @endif
@php $delivery = Cart::search(function ($cartItem, $rowId) { return $cartItem->associatedModel === "App\DeliveryDetails"; }); @endphp @if($delivery !== null && count($delivery) > 0)

Cart totals

@foreach ($delivery as $deliveryItem) @endforeach
Subtotal £{{ number_format((\Gloudemans\Shoppingcart\Facades\Cart::subtotal() - $delivery->first()->total), 2) }}
Delivery £{{ number_format($deliveryItem->total, 2) }}
Total £{{\Gloudemans\Shoppingcart\Facades\Cart::subtotal()}}
@else

Cart totals

Total £{{\Gloudemans\Shoppingcart\Facades\Cart::subtotal()}}
@endif
@guest Checkout @else Continue to Payment @endif
@endsection @section("myjsfile") @endsection