@php
$now = \Carbon\Carbon::now();
if($now->format('l') !== "Tuesday")
$now = \Carbon\Carbon::parse('next tuesday');
$now = $now->addDays(3)
@endphp
@foreach(App\Http\Controllers\ShoppingCartController::getCartByDeliveryDate() as $deliveryDay => $items)
YOUR EDIBLE16 BASKET
|
@foreach($items as $cartItem)
@if($cartItem->associatedModel == "App\Product")
{{ $cartItem->model->name ?? $cartItem->name }}
× {{ $cartItem->qty }}
|
£{{ number_format($cartItem->total, 2) }}
|
@endif
@if($cartItem->associatedModel == "App\DiscountCode")
DISCOUNT {{ $cartItem->model->name ?? $cartItem->name }} |
£{{ number_format($cartItem->total, 2) }}
|
@endif
@endforeach
@endforeach
@php
$packaging = Cart::search(function ($cartItem, $rowId) {
return $cartItem->associatedModel === "App\PackagingDetails";
});
@endphp
@if($packaging !== null && count($packaging) > 0)
@foreach ($packaging as $packagingItem)
{{ $packagingItem->name }}
|
£{{ number_format($packagingItem->total, 2) }}
|
@endforeach
@endif
@php
$delivery = Cart::search(function ($cartItem, $rowId) {
return $cartItem->associatedModel === "App\DeliveryDetails";
});
@endphp
@if($delivery !== null && count($delivery) > 0)
@foreach ($delivery as $deliveryItem)
{{ $deliveryItem->name }}
|
@if($deliveryItem->total == "0.00")
FREE COLLECTION
@else
£{{ number_format($deliveryItem->total, 2) }}
@endif
|
@endforeach
@endif
@php
$discount = Cart::search(function ($cartItem, $rowId) {
return $cartItem->associatedModel === "App\DiscountCode";
});
$discount = (count($discount) > 0) ? $discount->first() : FALSE;
@endphp
@if($discount && $discount->model->type == \App\DiscountCode::FREEPURCHASE())
SUBTOTAL |
FREE
|
@else
SUBTOTAL |
£{{ (\Gloudemans\Shoppingcart\Facades\Cart::total() > 0) ? \Gloudemans\Shoppingcart\Facades\Cart::total() : '0.00' }}
|
@endif
|