@extends('../site/layouts.app') @section('page_title', __('Cart')) @section('content') @php $carts = \App\Cart\Cart::cartCollection()->sortKeys(); @endphp
@include('site.layouts.includes.order_steps', ['stepsNumber' => 1])

{{ __('Select the items you want to buy') }}

@if (count($carts) > 0)
@endif @if (count($cartData) > 0) @foreach ($cartData->groupBy('vendor_id') as $key => $cartData) @php $estimateTime = ''; if (isset($cartData[0]['vendor_id'])) { $minDays = $cartData->where('vendor_id', $cartData[0]['vendor_id'])->min('estimated_delivery'); $maxDays = $cartData->where('vendor_id', $cartData[0]['vendor_id'])->max('estimated_delivery'); } else { $minDays = $cartData->where('vendor_id', null)->min('estimated_delivery'); $maxDays = $cartData->where('vendor_id', null)->max('estimated_delivery'); } if (!empty($minDays) && !empty($maxDays)) { $estimateTime = $minDays != $maxDays ? $minDays . " - " . $maxDays . " " . __('days') : $minDays . " " . __('days'); } elseif (!empty($minDays) && empty($maxDays)) { $estimateTime = $minDays . " " . __('days'); } elseif (empty($minDays) && !empty($maxDays)) { $estimateTime = $maxDays . " " . __('days'); } @endphp
@if (isset($vendors[$cartData[0]['vendor_id']]))

{{ $estimateTime }}

@else

{{ $estimateTime }}

@endif
@foreach ($cartData as $cart)

{{ $cart['name'] }}

@if ($cart['type'] == 'Variable Product')
@php $variationMeta = (array) json_decode($cart['variation_meta']); $commaCount = 0; @endphp @if ($variationMeta != null && count($variationMeta) > 0) @foreach ($variationMeta as $metaKey => $name) @php $commaCount++ @endphp @if ($loop->iteration == 1) {{ $metaKey . ' : ' . $name }} {{ count($variationMeta) < $commaCount ? ',' : '' }} @else {{ $metaKey . ' : ' . $name }} {{ count($variationMeta) < $commaCount ? ',' : '' }} @endif @endforeach @endif
@endif

{{ formatNumber($cart['price']) }}

@if ($cart['is_individual_sale'] == 0) @endif

{{ $cart['quantity'] }}

@if ($cart['is_individual_sale'] == 0) @endif
@if (preference('wishlist')) @php $active = false; if (auth()->user()) { foreach (auth()->user()->wishlist as $key => $wishlist) { if ($cart['id'] == $wishlist->product_id) { $active = true; } } } @endphp @endif @if ($cart['availability'] == 0 || $cart['inventoryEnable'] == false) @endif
@endforeach
@endforeach @else

{{ __('Empty!') }}

@endif @if($errors->any()) {{ implode('', $errors->all()) }} @endif
{{ __('Continue Shopping') }}

{{ __('Order Summary') }}

{{ __('Subtotal') }}

0
@if (isActive('Shipping'))
@endif @php $couponOffer = 0; @endphp @if (isset($coupon) && !empty($coupon)) @php $couponOffer = $coupon; @endphp @endif @if (isActive('Coupon') && preference('coupons') == 1) @endif @if (preference("taxes") == 1)
{{ __('Tax') }}
@endif
{{ __('Total Amount') }}
{{ formatCurrencyAmount($totalPrice - $couponOffer) }}
@if (isActive('Coupon') && preference('coupons') == 1)

{{ __('Have a coupon? Apply Now.') }}

@endif
{{ __('Proceed to Checkout') }} @php $gateways = (new \Modules\Gateway\Entities\GatewayModule())->payableGateways(); @endphp @if (is_array($gateways) && count($gateways) > 0)

{{ __('Accepted payment method') }}

@foreach ($gateways as $gateway)
{{ __('Image') }}
@endforeach
@endif
@endsection @section('js') @endsection