@extends('website.layouts.master') @section('css') {{-- --}} @stop @section('script.title') @stop @section('content')
@php $geoip = geoip(get_visitor_IP()); $geoip_country = $business_areas->where('iso_code', $geoip->iso_code)->first(); $shipping_country_id = $cart->ship_to_country_id ?? optional($geoip_country)->id; if (!$cart->shipping_state_id) { $geoip_state = \DB::table('states') ->select('id', 'name', 'iso_code') ->where([['country_id', '=', $shipping_country_id], ['iso_code', '=', $geoip->state]]) ->first(); } $shipping_state_id = $cart->ship_to_state_id ?? optional($geoip_state)->id; // $shipping_zone = get_shipping_zone_of($cart->shop_id, $shipping_country_id, $shipping_state_id); // $shipping_options = isset($shipping_zone->id) ? getShippingRates($shipping_zone->id) : 'NaN'; $packaging_options = optional($cart->shop)->packagings; $default_packaging = $cart->shippingPackage ?? (optional($cart->shop->packagings) ->where('default', 1) ->first() ?? $platformDefaultPackaging); @endphp
@if (Session::has('error'))
{{ trans('theme.error') }} {{ Session::get('error') }}
@endif
{{ trans('theme.warning') }} @lang('theme.notify.seller_doesnt_ship')
{!! Form::open(['route' => ['order.create', $cart], 'id' => 'formId' . $cart->id, 'name' => 'checkoutForm', 'files' => true, 'data-toggle' => 'validator', 'autocomplete' => 'off', 'novalidate']) !!}
{{ trans('theme.sold_by') }}
{{ $shop->name }}
{{ Form::hidden('cart_id', $cart->id, ['id' => 'checkout-id']) }} {{ Form::hidden('cart_weight', $cart->shipping_weight, ['id' => 'cartWeight' . $cart->id]) }} {{ Form::hidden('free_shipping', $cart->is_free_shipping(), ['id' => 'freeShipping' . $cart->id]) }} {{ Form::hidden('shop_id', $cart->shop->id, ['id' => 'shop-id' . $cart->id]) }} {{ Form::hidden('tax_id', isset($shipping_zones[$cart->id]->i) ? $shipping_zones[$cart->id]->tax_id : null, ['id' => 'tax-id' . $cart->id]) }} {{ Form::hidden('taxrate', $cart->taxrate, ['id' => 'cart-taxrate' . $cart->id]) }} {{ Form::hidden('packaging_id', $cart->packaging_id ?? optional($default_packaging)->id, ['id' => 'packaging-id' . $cart->id]) }} {{ Form::hidden('shipping_zone_id', $cart->shipping_zone_id, ['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',$cart->handling_cost > 0 ? $cart->handling_cost : optional($cart->shop->config)->order_handling_cost,['id' => 'handling-cost' . $cart->id]) }}

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

  • {{ trans('theme.item_count') }}
    {{-- وصف مختصر--}}
    {{ $cart->inventories_count + $cart->auctions()->count() }}
  • {{ trans('theme.quantity') }}
    @php $auctions_quantity = 0; foreach($cart->auctions as $auction){ $auctions_quantity+= $auction->quantity ; } @endphp {{ $cart->quantity + $auctions_quantity }} {{-- @if($cart->auctions != null)--}} {{-- {{ $cart->auctions()->quantity .' '. __('theme.auction') }}--}} {{-- @endif--}}
  • {{ trans('theme.subtotal') }}
    {{-- وصف مختصر--}}
    @php $auction_total = 0; foreach ($cart->auctions as $auction) { $auction_total += $auction->bids()->where('status',1)->first()->price; } $total = $auction_total + $cart->total @endphp {{ get_currency_prefix() }} {{ number_format($cart->total + $auction_total, 2, '.', '') }} {{ get_currency_suffix() }}
  • {{ get_currency_prefix() }} {{ number_format($cart->get_shipping_cost(), 2, '.', '') }} {{ get_currency_suffix() }}
  • @unless(empty(json_decode($packaging_options)))
  • {{ trans('theme.packaging') }} {{ optional($default_packaging)->name }}
    {{ get_currency_prefix() }} {{ number_format($default_packaging ? $default_packaging->cost : 0, 2, '.', '') }} {{ get_currency_suffix() }}
  • @endunless
  • {{ 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.taxes') }}
    {{ get_currency_prefix() }} {{ number_format($cart->taxes, 2, '.', '') }} {{ get_currency_suffix() }}
  • {{ trans('theme.total') }} {{ get_currency_prefix() }} {{ number_format($cart->calculate_grand_total(), 2, '.', '') }} {{ get_currency_suffix() }}
@include('partials.payment_options')

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

@if (isset($customer))
@php $pre_select = null; @endphp @foreach ($customer->addresses as $address) @php $ship_to_this_address = null; // If any address not selected yet if ($pre_select == null) { // Has onely address if ($customer->addresses->count() == 1) { $pre_select = 1; $ship_to_this_address = true; } // Just created this address elseif (Request::has('address')) { if (Request::get('address') == $address->id) { $pre_select = 1; $ship_to_this_address = true; } } // Zone selected at cart page elseif ($cart->ship_to_country_id == $address->country_id && $cart->ship_to_state_id == $address->state_id) { $pre_select = 1; $ship_to_this_address = true; } // Customer's shipping address elseif ($cart->ship_to == null && $address->address_type === 'Shipping') { $pre_select = 1; $ship_to_this_address = true; } } @endphp
{!! $address->toHtml('
', false) !!}
@if ($loop->iteration % 2 == 0)
@endif @endforeach
{{-- When the custoer has no address --}} {{-- @unless($customer->addresses->count()) @include('partials.address_form', ['countries' => $business_areas->pluck('name', 'id')]) @endunless --}}
@else @include('partials.checkout_shiping_address') @endif

@if (is_incevio_package_loaded('pharmacy')) @include('pharmacy::checkout_form') @endif
{{-- --}} {!! Form::label('buyer_note', trans('theme.leave_message_to_seller')) !!}
{!! Form::textarea('buyer_note', null, ['class' => 'form-control flat summernote-without-toolbar', 'placeholder' => trans('theme.placeholder.message_to_seller'), 'rows' => '2', 'maxlength' => '250']) !!}
{!! Form::close() !!}
@stop @section('script') @include('scripts.checkout') @include('website.scripts.dynamic_checkout') @stop