@extends('frontend.layouts.amp') @section('title', 'Checkout - ' . app_name()) @section('content')

CHECKOUT

@if(!$data['customer'])

Returning customer? Click here to login

{{ html()->form('POST', route('frontend.auth.login.post'))->open() }} {{ html()->form()->close() }}
@endif {{-- --}}
Please select from already saved addresses:
@if($data['customer'] && count($data['customer']->addresses) > 0) @foreach($data['customer']->addresses as $address)
{{ $address->first_name . ' ' . $address->last_name }}
@if(trim($address->company) != null) {{ $address->company }}
@endif {!! $address->address1.'
'. ( empty($address->address2) ? '' : $address->address2 . '
' ) . $address->city.', '. \App\Models\State::get_state_name($address->state) .', '.$address->zip.'
'. \App\Models\Country::get_country_name($address->country) !!} @if(trim($address->phone) != null)
Tel: {{ $address->phone }} @endif
id) checked="checked" @endif>
@endforeach
@endif
{!! Form::open(array('method' => 'POST', 'id' => 'frm_checkout_address')) !!}
@if(!$data['customer'])
{!! Form::label('email', 'Email Address:') !!} {!! Form::text('email', $data['v_shipping_details']['email'], ['type' => 'email', 'required' => 'required', 'class' => 'form-control', 'placeholder' => 'Enter email address ...', 'id' => 'sp_email']) !!}
@endif
{!! Form::label('first_name', 'First Name:') !!} {!! Form::text('first_name', $data['v_shipping_details']['first_name'],['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter first name ...']) !!}
{!! Form::label('last_name', 'Last Name:') !!} {!! Form::text('last_name', $data['v_shipping_details']['last_name'],['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter last name ...']) !!}
{!! Form::label('company', 'Company:') !!} {!! Form::text('company', $data['v_shipping_details']['company'],['class'=>'form-control', 'placeholder'=>'Enter company name ...']) !!}
{!! Form::text('address1', $data['v_shipping_details']['address1'],['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter address line 1...', 'id' => 'address1']) !!}
{!! Form::text('address2', $data['v_shipping_details']['address2'],['class'=>'form-control', 'placeholder'=>'Enter address line 2 ...', 'id' => 'address2']) !!}
{!! Form::label('country', 'Country:') !!} {!! Form::select('country', $data['countries'], $data['v_shipping_details']['country'],['class'=>'form-control', 'required' => 'required', 'onchange="get_states(this.value);"', 'placeholder'=>'Select country ...']) !!}
{!! Form::label('state', 'State:') !!}
@php $show_text_field = true; if(isset($data['address'])) { if(is_numeric($data['address']->state)) $show_text_field = false; } @endphp @if($show_text_field) {!! Form::text('state', $data['v_shipping_details']['state'], ['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter state ...']) !!} @else {!! Form::select('state', $data['states'], $data['v_shipping_details']['state'],['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter state ...']) !!} @endif
{!! Form::label('city', 'City:') !!} {!! Form::text('city', $data['v_shipping_details']['city'],['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter city ...']) !!}
{!! Form::label('zip', 'Zip / Post Code:') !!} {!! Form::text('zip', $data['v_shipping_details']['zip'],['maxlength' => '9', 'class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter zip / post code ...']) !!}
{!! Form::label('phone', 'Phone:') !!} {!! Form::text('phone', $data['v_shipping_details']['phone'],['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter phone ...']) !!}
@if($data['customer'] && count($data['customer']->addresses) > 0) @endif
{!! Form::close() !!}
{!! Form::open(array('route' => 'frontend.save-order', 'method' => 'POST', 'id' => 'frm_checkout_shipping')) !!}
@if(isset($data['rates']) && !isset($data['rates']['status'])) @foreach($data['rates'] as $service)
@endforeach @elseif(isset($data['rates']) && isset($data['rates']['status']) && $data['rates']['status'] == 0) @else Sorry, no quotes are available for this order at this time. @endif
@php $notes = ''; if(isset($data['shipping_details']['notes'])) $notes = $data['shipping_details']['notes']; @endphp
{!! Form::label('notes', 'Shipping / Order Notes:') !!} {!! Form::textarea('notes', $notes, ['rows' => 4, 'class'=>'form-control', 'placeholder'=>'Notes about your order, e.g. special notes for delivery ...']) !!}
{!! Form::close() !!}
{{--
@php if((!empty($data['shipping_details']['email']) && isset($data['shipping_rate'])) || $data['checkout_step'] == '3') $css = ''; else $css = 'class="collapse"'; @endphp
{!! Form::open(array('route' => 'frontend.process-payment', 'method' => 'POST', 'id' => 'frm_payment')) !!}

Credit Card Details

@if(session()->get('flash_danger')) @endif
{!! Form::label('cc_name', 'Name on Card:') !!} {!! Form::text('cc_name', null, ['required' => 'required', 'class' => 'form-control', 'placeholder' => 'Name on Card ...', 'id' => 'cc_name']) !!}
{!! Form::label('cc_number', 'Card Number:') !!}
{!! Form::text('cc_number', null, ['required' => 'required', 'class' => 'form-control', 'placeholder' => 'Card Number ...', 'id' => 'cc_number']) !!}
{!! Form::hidden('cc_type', null, ['id' => 'cc_type']) !!}
{!! Form::label('cc_month', 'Expiry Month:') !!} {!! Form::select('cc_month', $data['months'], null, ['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Please Select ...']) !!}
{!! Form::label('cc_year', 'Expiry Year:') !!} {!! Form::select('cc_year', $data['years'], null, ['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Please Select ...']) !!}
{!! Form::label('cc_cvv', 'CVC:') !!} {!! Form::text('cc_cvv', null,['class'=>'form-control', 'required' => 'required', 'placeholder'=>'Enter CVC ...', 'maxlength' => 4]) !!}

--}}{{----}}{{--
get('move_to') == 'acc_payment_form') checked="checked" @endif>

{!! Form::close() !!}
--}}

ORDER REVIEW

Product Total

    @php $sub_total = 0; $bogo_discount = 0; @endphp @foreach($data['cart'] as $cart) @php //$sub_total += $cart->getPriceWithConditions(); $is_freebie = false; $freebie_qty = 0; if($cart->attributes->freebie) { $is_freebie = true; $freebie_qty = $cart->attributes->freebie_qty; $item_price = 0; $total_price = 0; } else { $item_price = $cart->getPriceWithConditions(); $total_price = $cart->getPriceSumWithConditions(); } if($cart->bogo_free) { $total_price_discount = $cart->bogo_free * $item_price; $bogo_discount += $total_price_discount; $talal_price_after_bogo = $total_price - $total_price_discount; } if($cart->bogod_count) { $discounted_price = ($item_price * $cart->bogod_percent) / 100; $total_price_discount = $cart->bogod_count * $discounted_price; $bogo_discount += $total_price_discount; $talal_price_after_bogo = $total_price - $total_price_discount; } $sub_total += $total_price; @endphp
  • {{ $cart->name }}
    {{ $cart->attributes->sku }}   ({{ $cart->quantity }}) @if($cart->bogo_free)
    {{ $cart->bogo_free }} free @if($cart->bogo_free > 1) items @else item @endif @elseif($cart->bogod_count)
    {{ $cart->bogod_percent }}% discount on {{ $cart->bogod_count }} @if($cart->bogod_count > 1) items @else item @endif @endif
    @if($is_freebie)
    Free Product
    @else @if($cart->bogo_free || $cart->bogod_count) ${{ number_format($talal_price_after_bogo, 2) }} {{--{{ $cart->bogo_free }} free @if($cart->bogo_free > 1) items @else item @endif--}} @else bogo_free || $cart->bogod_count) class="old-price" @endif>${{ number_format($cart->getPriceSumWithConditions(), 2) }} @endif @endif
  • @endforeach
@php $discount = 0; if(request()->session()->get('ses_coupon')) { $coupon = request()->session()->get('ses_coupon'); if($coupon['type'] == 'amount') { $discount = $coupon['value']; } else { $discount = ($sub_total * $coupon['value']) / 100; } } if($bogo_discount) { $discount += $bogo_discount; } if( request()->session()->get('ses_shipping_rate') ) { $shipping_rate = request()->session()->get('ses_shipping_rate'); if(!is_numeric($shipping_rate)) $shipping_rate = 0; } else $shipping_rate = 0; $grand_total = ($sub_total + $shipping_rate) - $discount; session()->put('ses_grand_total', $grand_total); @endphp

Sub Total ${{ number_format($sub_total, 2) }}

Discount ${{ number_format($discount, 2) }}

Shipping Fee {{ $data['shipping_rate'] ?? "$0.00" }}

Grand Total ${{ number_format($grand_total, 2) }}

{{--
--}}
@endpush @endsection