@extends('website.layouts.master') @section('css') {{-- --}} {{-- --}} @stop @section('script.title') @stop @section('content')
@if ($carts->count() > 0) @foreach ($carts as $cart) @php $cart_total = 0; $packaging_options = optional($cart->shop)->packagings; if ($cart->shop) { $default_packaging = $cart->shippingPackage ?? (optional($cart->shop->packagings) ->where('default', 1) ->first() ?? $platformDefaultPackaging); } else { $default_packaging = $cart->shippingPackage ?? $platformDefaultPackaging; } @endphp
{{-- --}} {{-- --}}
{!! Form::model($cart, ['method' => 'PUT', 'route' => ['cart.checkout', $cart->id], 'id' => 'formId' . $cart->id]) !!} {{ Form::hidden('cart_id', $cart->id, ['id' => 'cart-id' . $cart->id]) }} {{ Form::hidden('shop_id', $cart->shop->id, ['id' => 'shop-id' . $cart->id]) }} {{ Form::hidden('tax_id', isset($shipping_zones[$cart->id]->id) ? $shipping_zones[$cart->id]->tax_id : null, ['id' => 'tax-id' . $cart->id]) }} {{ Form::hidden('taxrate', null, ['id' => 'cart-taxrate' . $cart->id]) }} {{ Form::hidden('packaging_id', $default_packaging ? $default_packaging->id : null, ['id' => 'packaging-id' . $cart->id]) }} {{ Form::hidden('ship_to', $cart->ship_to, ['id' => 'ship-to' . $cart->id]) }} {{ Form::hidden('shipping_zone_id',isset($shipping_zones[$cart->id]->id) ? $shipping_zones[$cart->id]->id : null,['id' => 'zone-id' . $cart->id]) }} {{ Form::hidden('shipping_rate_id', $cart->shipping_rate_id, ['id' => 'shipping-rate-id' . $cart->id]) }} {{ Form::hidden('ship_to_country_id', $cart->ship_to_country_id, ['id' => 'shipto-country-id' . $cart->id]) }} {{ Form::hidden('ship_to_state_id', $cart->ship_to_state_id, ['id' => 'shipto-state-id' . $cart->id]) }} {{ Form::hidden('coupon_raw', json_encode($cart->coupon), ['id' => 'coupon-raw' . $cart->id]) }} {{-- {{ Form::hidden('discount_id', $cart->coupon_id, ['id' => 'discount-id' . $cart->id]) }} --}} {{ Form::hidden('handling_cost', optional($cart->shop->config)->order_handling_cost, ['id' => 'handling-cost' . $cart->id]) }}

{{ trans('theme.shoping_cart') }}

@lang('theme.store'): @if ($cart->shop->slug) {{ $cart->shop->name }} @else @lang('theme.store_not_available') @endif
@lang('theme.ship_to'): @php $country_translation = $cart->country->translations->where('language_id',getLocaleId())->first(); $state_translation = $cart->state->translations->where('language_id',getLocaleId())->first(); @endphp {{ $cart->ship_to_state_id ? ($state_translation->name ?? $cart->state->name) : ($country_translation->name ?? $cart->country->name) }}
@foreach ($cart->inventories as $item) @php $item_translation = $item->translations->where('language_id',getLocaleId())->first(); $unit_price = $item->current_sale_price(); $item_total = $unit_price * $item->pivot->quantity; $cart_total += $item_total; @endphp @endforeach @foreach ($cart->auctions as $item) @php $auction_item_translation = $item->translations->where('language_id',getLocaleId())->first(); $unit_price = $item->bids()->where('auction_id',$item->id)->where('status',1)->where('verification',0)->first()->price; $item_total = $unit_price; $cart_total += $item_total; @endphp @endforeach
{{ trans('theme.image') }} {{ trans('theme.description') }} {{ trans('theme.price') }} {{ trans('theme.quantity') }} {{ trans('theme.total') }}
{{ Form::hidden('shipping_weight[' . $item->id . ']', $item->shipping_weight * $item->pivot->quantity, ['id' => 'itemWeight' . $item->id,'class' => 'itemWeight' . $cart->id]) }} {{ $item_translation->title ?? $item->title }} @if($item_translation) {{$item->sku.' - '.$item_translation->title.' - '.$item->condition}} @else {{ $item->pivot->item_description }} @endif {{ get_currency_prefix() }} {{ number_format($unit_price, 2, '.', '') }} {{ get_currency_suffix() }}
{{ get_currency_prefix() }} {{ number_format($item_total, 2, '.', '') }} {{ get_currency_suffix() }} {{-- ×--}}
{{-- --}} {{-- --}} {{-- {{ Form::hidden('shipping_weight[' . $item->id . ']', $item->shipping_weight * $item->pivot->quantity, ['id' => 'itemWeight' . $item->id,'class' => 'itemWeight' . $cart->id]) }}--}} {{ $auction_item_translation->title ?? $item->title }} {{ $auction_item_translation->title ?? $item->title }} {{ get_currency_prefix() }} {{ number_format($unit_price, 2, '.', '') }} {{ get_currency_suffix() }} {{--
--}} {{-- --}} {{-- --}} {{--
--}}
{{ get_currency_prefix() }} {{ number_format($item_total, 2, '.', '') }} {{ get_currency_suffix() }} {{-- ×--}}
{!! Form::close() !!}
{{-- --}} {{-- --}}

{{ trans('theme.cart_summary') }}

@unless(empty(json_decode($packaging_options))) @endunless
{{ trans('theme.subtotal') }} {{ get_currency_prefix() }} {{ number_format($cart_total, 2, '.', '') }} {{ get_currency_suffix() }}
{{ trans('theme.shipping') }} {{ get_currency_prefix() }} {{ number_format(0, 2, '.', '') }} {{ get_currency_suffix() }}
{{ trans('theme.packaging') }} {{ $default_packaging ? $default_packaging->name : '' }} {{ get_currency_prefix() }} {{ number_format($default_packaging ? $default_packaging->cost : 0, 2, '.', '') }} {{ get_currency_suffix() }}
{{ trans('theme.discount') }} {{ $cart->coupon ? $cart->coupon->name . ' (' . $cart->coupon->getFormatedAmountText() . ')' : '' }} -{{ get_currency_prefix() }} {{ $cart->coupon ? number_format($cart->discount, 2, '.', '') : number_format(0, 2, '.', '') }} {{ get_currency_suffix() }}
{{ trans('theme.total') }} {{ get_currency_prefix() }} {{ number_format(0, 2, '.', '') }} {{ get_currency_suffix() }}
@if (allow_checkout()) @else {{ trans('theme.button.buy_from_this_seller') }} @endif {{-- استكمال الدفع--}}
@endforeach
@if (is_incevio_package_loaded('checkout')) @include('checkout::_checkout_button') @endif
@else

{{ trans('theme.empty_cart') }}

@lang('theme.button.shop_now')

@endif
@stop @section('script') @include('website.modals.ship_to') @include('website.cart.scripts.cart') @include('website.cart.scripts.dynamic_checkout') @stop