@extends('web_stores.layouts.app') @section('content')

{{$page_title}}

{!!Form::open(['url'=>url()->full(),'id'=>'checkout-form'])!!}
@if(count($carts)) @foreach($carts as $row) @php $i=0; @endphp
{{$row['company_name']}}
@php $currency_code = $row['currency_code']; @endphp
@foreach($row['items'] as $index => $item) @if(isset($item['document_status'])) @if($i > 0)
@endif
{!!Form::hidden('item['.$item['product_id'].'][product_id]', $item['product_id'])!!}
{{$item['product_name']}} x {{$item['product_quantity']}} {{$row['currency_code']}} {{$setting->getDouble($item['product_price'])}}
@foreach($item['document_status'] as $index => $document_status) @endforeach
@php $i++; $total += ($item['product_quantity'] * $item['product_price']); @endphp @endif @endforeach
@endforeach @if($total > 0)
{{App\Language::trans('Payment Method')}}
@endif
{{App\Language::trans('Shipping Cost & Weight')}}

{{App\Language::trans('Total Weight :')}} 0 KG

{{App\Language::trans('Total Amount :')}} {{$currency_code}}{{$setting->getDouble(0)}}

@endif {!!Form::close()!!}
{{App\Language::trans('Total Payment')}} : {{$currency_code}}{{$setting->getDouble($total)}} @if($total > 0) {{App\Language::trans('Place Order')}} @endif
@stop @section('script') $$(".btn-order").on("click", function(){ $("form").submit(); }); init_total_summary(); function init_total_summary() { var isOnlinePay = 0; var isDelivery = 0; $("input[name*=document_status]:checked").each(function(){ var item = $(this).closest(".item"); if($(this).data("is-online-pay")) { var quantity = item.find(".quantity").html(); var price = item.find(".price").html(); isOnlinePay += parseFloat(quantity) * parseFloat(price); } if($(this).data("is-delivery")) { isDelivery += parseFloat(item.find(".weight").html()); } }); {{-- init delivery cost if exist --}} $.get("{{action('AppsWebStoresController@getDeliveryCost', ['secret_token'=>$secret_token])}}", {weight:isDelivery}, function(data){ isOnlinePay += parseFloat(data.total); $(".total_weight").html(isDelivery); $(".total_weight_cost").html(init_decimal_point(data.total)); $(".total_payment").html(init_decimal_point(isOnlinePay)); },"json"); } @stop