@extends('layouts.master') @section('page') Cart | {{setting('site.title')}} @endsection @section('content')
@if (session()->has('success_message'))
{{ session()->get('success_message') }}
@endif @if(count($errors) > 0)
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if (auth()->user()->cart->count() > 0)

{{auth()->user()->cart->sum('quantity')}} item(s) in Shopping Cart


@endif
@if (auth()->user()->cart->count() > 0)
Products
@foreach (auth()->user()->cart as $item)
@if ($item->product->on_sale)

${{$item->product->on_sale}}

@else

${{$item->product->price}}

@endif
@csrf
@if ($item->product->on_sale) @else @endif
{{ csrf_field() }} {{method_field('DELETE')}}
@endforeach

Cart total

Subtotal $ {{auth()->user()->cart->sum('price')}}
Shipping $ 2.00
Total $ {{auth()->user()->cart->sum('price') + 2.00}}
Proceed to checkout Continue Shopping
@else

Your cart is currently empty.

@endif
@if (auth()->user()->cart->count() > 0)

You Might Also Like...

@foreach ($might_also_like as $item)
{{$item->name}}
@if ($item->on_sale)

$ {{$item->price}}

$ {{$item->on_sale}}

@else @if($item->price > 0)

$ {{$item->price}}

@else Ask for price @endif @endif
@endforeach
@endif
@endsection @push('styles') @endpush() @push('scripts') @endpush