codigo actual del servidor, con avances de joan
This commit is contained in:
152
resources/views/seller/orders/index.blade.php
Normal file
152
resources/views/seller/orders/index.blade.php
Normal file
@@ -0,0 +1,152 @@
|
||||
@extends('seller.layouts.app')
|
||||
|
||||
@section('panel_content')
|
||||
|
||||
<div class="card">
|
||||
<form id="sort_orders" action="" method="GET">
|
||||
<div class="card-header row gutters-5">
|
||||
<div class="col text-center text-md-left">
|
||||
<h5 class="mb-md-0 h6">{{ translate('Orders') }}</h5>
|
||||
</div>
|
||||
<div class="col-md-3 ml-auto">
|
||||
<select class="form-control aiz-selectpicker"
|
||||
data-placeholder="{{ translate('Filter by Payment Status') }}" name="payment_status"
|
||||
onchange="sort_orders()">
|
||||
<option value="">{{ translate('Filter by Payment Status') }}</option>
|
||||
<option value="paid"
|
||||
@isset($payment_status) @if ($payment_status == 'paid') selected @endif @endisset>
|
||||
{{ translate('Paid') }}</option>
|
||||
<option value="unpaid"
|
||||
@isset($payment_status) @if ($payment_status == 'unpaid') selected @endif @endisset>
|
||||
{{ translate('Unpaid') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 ml-auto">
|
||||
<select class="form-control aiz-selectpicker"
|
||||
data-placeholder="{{ translate('Filter by Payment Status') }}" name="delivery_status"
|
||||
onchange="sort_orders()">
|
||||
<option value="">{{ translate('Filter by Deliver Status') }}</option>
|
||||
<option value="pending"
|
||||
@isset($delivery_status) @if ($delivery_status == 'pending') selected @endif @endisset>
|
||||
{{ translate('Pending') }}</option>
|
||||
<option value="confirmed"
|
||||
@isset($delivery_status) @if ($delivery_status == 'confirmed') selected @endif @endisset>
|
||||
{{ translate('Confirmed') }}</option>
|
||||
<option value="on_delivery"
|
||||
@isset($delivery_status) @if ($delivery_status == 'on_delivery') selected @endif @endisset>
|
||||
{{ translate('On delivery') }}</option>
|
||||
<option value="delivered"
|
||||
@isset($delivery_status) @if ($delivery_status == 'delivered') selected @endif @endisset>
|
||||
{{ translate('Delivered') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="from-group mb-0">
|
||||
<input type="text" class="form-control" id="search" name="search"
|
||||
@isset($sort_search) value="{{ $sort_search }}" @endisset
|
||||
placeholder="{{ translate('Type Order code & hit Enter') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@if (count($orders) > 0)
|
||||
<div class="card-body p-3">
|
||||
<table class="table aiz-table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ translate('Order Code') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Num. of Products') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Customer') }}</th>
|
||||
<th data-breakpoints="md">{{ translate('Amount') }}</th>
|
||||
<th data-breakpoints="lg">{{ translate('Delivery Status') }}</th>
|
||||
<th>{{ translate('Payment Status') }}</th>
|
||||
<th class="text-right">{{ translate('Options') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($orders as $key => $order_id)
|
||||
@php
|
||||
$order = \App\Models\Order::find($order_id->id);
|
||||
@endphp
|
||||
@if ($order != null)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $key + 1 }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="#{{ $order->code }}"
|
||||
onclick="show_order_details({{ $order->id }})">{{ $order->code }}</a>
|
||||
|
||||
@if (addon_is_activated('pos_system') && $order->order_from == 'pos')
|
||||
<span class="badge badge-inline badge-danger">{{ translate('POS') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ count($order->orderDetails->where('seller_id', Auth::user()->id)) }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($order->user_id != null)
|
||||
{{ optional($order->user)->name }}
|
||||
@else
|
||||
{{ translate('Guest') }} ({{ $order->guest_id }})
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ single_price($order->grand_total) }}
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$status = $order->delivery_status;
|
||||
@endphp
|
||||
{{ translate(ucfirst(str_replace('_', ' ', $status))) }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($order->payment_status == 'paid')
|
||||
<span class="badge badge-inline badge-success">{{ translate('Paid') }}</span>
|
||||
@else
|
||||
<span class="badge badge-inline badge-danger">{{ translate('Unpaid') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (addon_is_activated('pos_system') && $order->order_from == 'pos')
|
||||
<a class="btn btn-soft-success btn-icon btn-circle btn-sm"
|
||||
href="{{ route('seller.invoice.thermal_printer', $order->id) }}" target="_blank"
|
||||
title="{{ translate('Thermal Printer') }}">
|
||||
<i class="las la-print"></i>
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('seller.orders.show', encrypt($order->id)) }}"
|
||||
class="btn btn-soft-info btn-icon btn-circle btn-sm"
|
||||
title="{{ translate('Order Details') }}">
|
||||
<i class="las la-eye"></i>
|
||||
</a>
|
||||
<a href="{{ route('seller.invoice.download', $order->id) }}"
|
||||
class="btn btn-soft-warning btn-icon btn-circle btn-sm"
|
||||
title="{{ translate('Download Invoice') }}">
|
||||
<i class="las la-download"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="aiz-pagination">
|
||||
{{ $orders->links() }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
function sort_orders(el) {
|
||||
$('#sort_orders').submit();
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
302
resources/views/seller/orders/show.blade.php
Normal file
302
resources/views/seller/orders/show.blade.php
Normal file
@@ -0,0 +1,302 @@
|
||||
@extends('seller.layouts.app')
|
||||
|
||||
@section('panel_content')
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h1 class="h2 fs-16 mb-0">{{ translate('Order Details') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row gutters-5">
|
||||
<div class="col text-md-left text-center">
|
||||
</div>
|
||||
@php
|
||||
$delivery_status = $order->delivery_status;
|
||||
$payment_status = $order->orderDetails->where('seller_id', Auth::user()->id)->first()->payment_status;
|
||||
@endphp
|
||||
@if (get_setting('product_manage_by_admin') == 0)
|
||||
<div class="col-md-3 ml-auto">
|
||||
<label for="update_payment_status">{{ translate('Payment Status') }}</label>
|
||||
@if (($order->payment_type == 'cash_on_delivery' || (addon_is_activated('offline_payment') == 1 && $order->manual_payment == 1)) && $payment_status == 'unpaid')
|
||||
<select class="form-control aiz-selectpicker" data-minimum-results-for-search="Infinity"
|
||||
id="update_payment_status">
|
||||
<option value="unpaid" @if ($payment_status == 'unpaid') selected @endif>
|
||||
{{ translate('Unpaid') }}</option>
|
||||
<option value="paid" @if ($payment_status == 'paid') selected @endif>
|
||||
{{ translate('Paid') }}</option>
|
||||
</select>
|
||||
@else
|
||||
<input type="text" class="form-control" value="{{ translate($payment_status) }}" disabled>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-3 ml-auto">
|
||||
<label for="update_delivery_status">{{ translate('Delivery Status') }}</label>
|
||||
@if ($delivery_status != 'delivered' && $delivery_status != 'cancelled')
|
||||
<select class="form-control aiz-selectpicker" data-minimum-results-for-search="Infinity"
|
||||
id="update_delivery_status">
|
||||
<option value="pending" @if ($delivery_status == 'pending') selected @endif>
|
||||
{{ translate('Pending') }}</option>
|
||||
<option value="confirmed" @if ($delivery_status == 'confirmed') selected @endif>
|
||||
{{ translate('Confirmed') }}</option>
|
||||
<option value="picked_up" @if ($delivery_status == 'picked_up') selected @endif>
|
||||
{{ translate('Picked Up') }}</option>
|
||||
<option value="on_the_way" @if ($delivery_status == 'on_the_way') selected @endif>
|
||||
{{ translate('On The Way') }}</option>
|
||||
<option value="delivered" @if ($delivery_status == 'delivered') selected @endif>
|
||||
{{ translate('Delivered') }}</option>
|
||||
<option value="cancelled" @if ($delivery_status == 'cancelled') selected @endif>
|
||||
{{ translate('Cancel') }}</option>
|
||||
</select>
|
||||
@else
|
||||
<input type="text" class="form-control" value="{{ translate(ucfirst(str_replace('_', ' ', $delivery_status))) }}" disabled>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="row gutters-5 mt-2">
|
||||
<div class="col text-md-left text-center">
|
||||
@if(json_decode($order->shipping_address))
|
||||
<address>
|
||||
<strong class="text-main">
|
||||
{{ json_decode($order->shipping_address)->name }}
|
||||
</strong><br>
|
||||
{{ json_decode($order->shipping_address)->email }}<br>
|
||||
{{ json_decode($order->shipping_address)->phone }}<br>
|
||||
{{ json_decode($order->shipping_address)->address }}, {{ json_decode($order->shipping_address)->city }}, @if(isset(json_decode($order->shipping_address)->state)) {{ json_decode($order->shipping_address)->state }} - @endif {{ json_decode($order->shipping_address)->postal_code }}<br>
|
||||
{{ json_decode($order->shipping_address)->country }}
|
||||
</address>
|
||||
@else
|
||||
<address>
|
||||
<strong class="text-main">
|
||||
{{ $order->user->name }}
|
||||
</strong><br>
|
||||
{{ $order->user->email }}<br>
|
||||
{{ $order->user->phone }}<br>
|
||||
</address>
|
||||
@endif
|
||||
@if ($order->manual_payment && is_array(json_decode($order->manual_payment_data, true)))
|
||||
<br>
|
||||
<strong class="text-main">{{ translate('Payment Information') }}</strong><br>
|
||||
{{ translate('Name') }}: {{ json_decode($order->manual_payment_data)->name }},
|
||||
{{ translate('Amount') }}:
|
||||
{{ single_price(json_decode($order->manual_payment_data)->amount) }},
|
||||
{{ translate('TRX ID') }}: {{ json_decode($order->manual_payment_data)->trx_id }}
|
||||
<br>
|
||||
<a href="{{ uploaded_asset(json_decode($order->manual_payment_data)->photo) }}"
|
||||
target="_blank"><img
|
||||
src="{{ uploaded_asset(json_decode($order->manual_payment_data)->photo) }}" alt=""
|
||||
height="100"></a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-4 ml-auto">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Order #') }}</td>
|
||||
<td class="text-info text-bold text-right">{{ $order->code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Order Status') }}</td>
|
||||
<td class="text-right">
|
||||
@if ($delivery_status == 'delivered')
|
||||
<span
|
||||
class="badge badge-inline badge-success">{{ translate(ucfirst(str_replace('_', ' ', $delivery_status))) }}</span>
|
||||
@else
|
||||
<span
|
||||
class="badge badge-inline badge-info">{{ translate(ucfirst(str_replace('_', ' ', $delivery_status))) }}</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Order Date') }}</td>
|
||||
<td class="text-right">{{ date('d-m-Y h:i A', $order->date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Total amount') }}</td>
|
||||
<td class="text-right">
|
||||
{{ single_price($order->grand_total) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Payment method') }}</td>
|
||||
<td class="text-right">
|
||||
{{ translate(ucfirst(str_replace('_', ' ', $order->payment_type))) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Additional Info') }}</td>
|
||||
<td class="text-right">{{ $order->additional_info }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="new-section-sm bord-no">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 table-responsive">
|
||||
<table class="table-bordered aiz-table invoice-summary table">
|
||||
<thead>
|
||||
<tr class="bg-trans-dark">
|
||||
<th data-breakpoints="lg" class="min-col">#</th>
|
||||
<th width="10%">{{ translate('Photo') }}</th>
|
||||
<th class="text-uppercase">{{ translate('Description') }}</th>
|
||||
<th data-breakpoints="lg" class="text-uppercase">{{ translate('Delivery Type') }}</th>
|
||||
<th data-breakpoints="lg" class="min-col text-uppercase text-center">
|
||||
{{ translate('Qty') }}
|
||||
</th>
|
||||
<th data-breakpoints="lg" class="min-col text-uppercase text-center">
|
||||
{{ translate('Price') }}</th>
|
||||
<th data-breakpoints="lg" class="min-col text-uppercase text-right">
|
||||
{{ translate('Total') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($order->orderDetails as $key => $orderDetail)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>
|
||||
@if ($orderDetail->product != null && $orderDetail->product->auction_product == 0)
|
||||
<a href="{{ route('product', $orderDetail->product->slug) }}"
|
||||
target="_blank"><img height="50"
|
||||
src="{{ uploaded_asset($orderDetail->product->thumbnail_img) }}"></a>
|
||||
@elseif ($orderDetail->product != null && $orderDetail->product->auction_product == 1)
|
||||
<a href="{{ route('auction-product', $orderDetail->product->slug) }}"
|
||||
target="_blank"><img height="50"
|
||||
src="{{ uploaded_asset($orderDetail->product->thumbnail_img) }}"></a>
|
||||
@else
|
||||
<strong>{{ translate('N/A') }}</strong>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($orderDetail->product != null && $orderDetail->product->auction_product == 0)
|
||||
<strong><a href="{{ route('product', $orderDetail->product->slug) }}"
|
||||
target="_blank"
|
||||
class="text-muted">{{ $orderDetail->product->getTranslation('name') }}</a></strong>
|
||||
<small>{{ $orderDetail->variation }}</small>
|
||||
@elseif ($orderDetail->product != null && $orderDetail->product->auction_product == 1)
|
||||
<strong><a href="{{ route('auction-product', $orderDetail->product->slug) }}"
|
||||
target="_blank"
|
||||
class="text-muted">{{ $orderDetail->product->getTranslation('name') }}</a></strong>
|
||||
@else
|
||||
<strong>{{ translate('Product Unavailable') }}</strong>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($order->shipping_type != null && $order->shipping_type == 'home_delivery')
|
||||
{{ translate('Home Delivery') }}
|
||||
@elseif ($order->shipping_type == 'pickup_point')
|
||||
@if ($order->pickup_point != null)
|
||||
{{ $order->pickup_point->getTranslation('name') }}
|
||||
({{ translate('Pickup Point') }})
|
||||
@else
|
||||
{{ translate('Pickup Point') }}
|
||||
@endif
|
||||
@elseif($order->shipping_type == 'carrier')
|
||||
@if ($order->carrier != null)
|
||||
{{ $order->carrier->name }} ({{ translate('Carrier') }})
|
||||
<br>
|
||||
{{ translate('Transit Time').' - '.$order->carrier->transit_time }}
|
||||
@else
|
||||
{{ translate('Carrier') }}
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">{{ $orderDetail->quantity }}</td>
|
||||
<td class="text-center">
|
||||
{{ single_price($orderDetail->price / $orderDetail->quantity) }}</td>
|
||||
<td class="text-center">{{ single_price($orderDetail->price) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix float-right">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="text-muted">{{ translate('Sub Total') }} :</strong>
|
||||
</td>
|
||||
<td>
|
||||
{{ single_price($order->orderDetails->sum('price')) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="text-muted">{{ translate('Tax') }} :</strong>
|
||||
</td>
|
||||
<td>
|
||||
{{ single_price($order->orderDetails->sum('tax')) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="text-muted">{{ translate('Shipping') }} :</strong>
|
||||
</td>
|
||||
<td>
|
||||
{{ single_price($order->orderDetails->sum('shipping_cost')) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="text-muted">{{ translate('Coupon') }} :</strong>
|
||||
</td>
|
||||
<td>
|
||||
{{ single_price($order->coupon_discount) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<strong class="text-muted">{{ translate('TOTAL') }} :</strong>
|
||||
</td>
|
||||
<td class="text-muted h5">
|
||||
{{ single_price($order->grand_total) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="no-print text-right">
|
||||
<a href="{{ route('seller.invoice.download', $order->id) }}" type="button"
|
||||
class="btn btn-icon btn-light"><i class="las la-print"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script type="text/javascript">
|
||||
$('#update_delivery_status').on('change', function() {
|
||||
var order_id = {{ $order->id }};
|
||||
var status = $('#update_delivery_status').val();
|
||||
$.post('{{ route('seller.orders.update_delivery_status') }}', {
|
||||
_token: '{{ @csrf_token() }}',
|
||||
order_id: order_id,
|
||||
status: status
|
||||
}, function(data) {
|
||||
$('#order_details').modal('hide');
|
||||
AIZ.plugins.notify('success', '{{ translate('Order status has been updated') }}');
|
||||
location.reload().setTimeOut(500);
|
||||
});
|
||||
});
|
||||
|
||||
$('#update_payment_status').on('change', function() {
|
||||
var order_id = {{ $order->id }};
|
||||
var status = $('#update_payment_status').val();
|
||||
$.post('{{ route('seller.orders.update_payment_status') }}', {
|
||||
_token: '{{ @csrf_token() }}',
|
||||
order_id: order_id,
|
||||
status: status
|
||||
}, function(data) {
|
||||
$('#order_details').modal('hide');
|
||||
//console.log(data);
|
||||
AIZ.plugins.notify('success', '{{ translate('Payment status has been updated') }}');
|
||||
location.reload().setTimeOut(500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
276
resources/views/seller/orders/show_backup.blade.php
Normal file
276
resources/views/seller/orders/show_backup.blade.php
Normal file
@@ -0,0 +1,276 @@
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title strong-600 heading-5">{{ translate('Order id') }}: {{ $order->code }}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$status = $order->delivery_status;
|
||||
$payment_status = $order->orderDetails->where('seller_id', Auth::user()->id)->first()->payment_status;
|
||||
@endphp
|
||||
|
||||
<div class="modal-body gry-bg px-3 pt-0">
|
||||
@if (get_setting('product_manage_by_admin') == 0)
|
||||
<div class="row mt-5">
|
||||
@if ($order->payment_type == 'cash_on_delivery')
|
||||
<div class="offset-lg-2 col-lg-4 col-sm-6">
|
||||
<div class="form-group">
|
||||
<select class="form-control aiz-selectpicker form-control-sm"
|
||||
data-minimum-results-for-search="Infinity" id="update_payment_status">
|
||||
<option value="unpaid" @if ($payment_status == 'unpaid') selected @endif>
|
||||
{{ translate('Unpaid') }}</option>
|
||||
<option value="paid" @if ($payment_status == 'paid') selected @endif>
|
||||
{{ translate('Paid') }}</option>
|
||||
</select>
|
||||
<label>{{ translate('Payment Status') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-lg-4 col-sm-6">
|
||||
<div class="form-group">
|
||||
<select class="form-control aiz-selectpicker form-control-sm"
|
||||
data-minimum-results-for-search="Infinity" id="update_delivery_status">
|
||||
<option value="pending" @if ($status == 'pending') selected @endif>
|
||||
{{ translate('Pending') }}</option>
|
||||
<option value="confirmed" @if ($status == 'confirmed') selected @endif>
|
||||
{{ translate('Confirmed') }}</option>
|
||||
<option value="picked_up" @if ($status == 'picked_up') selected @endif>
|
||||
{{ translate('Picked Up') }}</option>
|
||||
<option value="on_the_way" @if ($status == 'on_the_way') selected @endif>
|
||||
{{ translate('On The Way') }}</option>
|
||||
<option value="delivered" @if ($status == 'delivered') selected @endif>
|
||||
{{ translate('Delivered') }}</option>
|
||||
<option value="cancelled" @if ($status == 'cancelled') selected @endif>
|
||||
{{ translate('Cancel') }}</option>
|
||||
</select>
|
||||
<label>{{ translate('Delivery Status') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<b class="fs-15">{{ translate('Order Summary') }}</b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<table class="table-borderless table">
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Order Code') }}:</td>
|
||||
<td>{{ $order->code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Customer') }}:</td>
|
||||
<td>{{ json_decode($order->shipping_address)->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Email') }}:</td>
|
||||
@if ($order->user_id != null)
|
||||
<td>{{ $order->user->email }}</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Shipping address') }}:</td>
|
||||
<td>{{ json_decode($order->shipping_address)->address }},
|
||||
{{ json_decode($order->shipping_address)->city }},
|
||||
{{ json_decode($order->shipping_address)->postal_code }},
|
||||
{{ json_decode($order->shipping_address)->country }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<table class="table-borderless table">
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Order date') }}:</td>
|
||||
<td>{{ date('d-m-Y H:i A', $order->date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Order status') }}:</td>
|
||||
<td>{{ translate($status) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Total order amount') }}:</td>
|
||||
<td>{{ single_price($order->grand_total) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Contact') }}:</td>
|
||||
<td>{{ json_decode($order->shipping_address)->phone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Payment method') }}:</td>
|
||||
<td>{{ translate(ucfirst(str_replace('_', ' ', $order->payment_type))) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="text-main text-bold">{{ translate('Additional Info') }}</td>
|
||||
<td class="text-right">{{ $order->additional_info }}</td>
|
||||
</tr>
|
||||
@if ($order->tracking_code)
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Tracking code') }}:</td>
|
||||
<td>{{ $order->tracking_code }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<b class="fs-15">{{ translate('Order Details') }}</b>
|
||||
</div>
|
||||
<div class="card-body pb-0">
|
||||
<table class="table-borderless table-responsive table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th width="40%">{{ translate('Product') }}</th>
|
||||
<th>{{ translate('Variation') }}</th>
|
||||
<th>{{ translate('Quantity') }}</th>
|
||||
<th>{{ translate('Delivery Type') }}</th>
|
||||
<th>{{ translate('Price') }}</th>
|
||||
@if (addon_is_activated('refund_request'))
|
||||
<th>{{ translate('Refund') }}</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($order->orderDetails->where('seller_id', Auth::user()->id) as $key => $orderDetail)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>
|
||||
@if ($orderDetail->product != null)
|
||||
<a href="{{ route('product', $orderDetail->product->slug) }}"
|
||||
target="_blank">{{ $orderDetail->product->getTranslation('name') }}</a>
|
||||
@else
|
||||
<strong>{{ translate('Product Unavailable') }}</strong>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $orderDetail->variation }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $orderDetail->quantity }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($order->shipping_type != null && $order->shipping_type == 'home_delivery')
|
||||
{{ translate('Home Delivery') }}
|
||||
@elseif ($order->shipping_type == 'pickup_point')
|
||||
@if ($order->pickup_point != null)
|
||||
{{ $order->pickup_point->getTranslation('name') }}
|
||||
({{ translate('Pickip Point') }})
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $orderDetail->price }}</td>
|
||||
@if (addon_is_activated('refund_request'))
|
||||
<td>
|
||||
@if ($orderDetail->refund_request != null && $orderDetail->refund_request->refund_status == 0)
|
||||
<b class="text-info">{{ translate('Pending') }}</b>
|
||||
@elseif ($orderDetail->refund_request != null && $orderDetail->refund_request->refund_status == 2)
|
||||
<b class="text-success">{{ translate('Rejected') }}</b>
|
||||
@elseif ($orderDetail->refund_request != null && $orderDetail->refund_request->refund_status == 1)
|
||||
<b class="text-success">{{ translate('Approved') }}</b>
|
||||
@elseif ($orderDetail->product->refundable != 0)
|
||||
<b>{{ translate('N/A') }}</b>
|
||||
@else
|
||||
<b>{{ translate('Non-refundable') }}</b>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<b class="fs-15">{{ translate('Order Ammount') }}</b>
|
||||
</div>
|
||||
<div class="card-body pb-0">
|
||||
<table class="table-borderless table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Subtotal') }}</th>
|
||||
<td class="text-right">
|
||||
<span
|
||||
class="strong-600">{{ single_price($order->orderDetails->where('seller_id', Auth::user()->id)->sum('price')) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Shipping') }}</th>
|
||||
<td class="text-right">
|
||||
<span
|
||||
class="text-italic">{{ single_price($order->orderDetails->where('seller_id', Auth::user()->id)->sum('shipping_cost')) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Tax') }}</th>
|
||||
<td class="text-right">
|
||||
<span
|
||||
class="text-italic">{{ single_price($order->orderDetails->where('seller_id', Auth::user()->id)->sum('tax')) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Coupon') }}</th>
|
||||
<td class="text-right">
|
||||
<span class="text-italic">{{ single_price($order->coupon_discount) }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="w-50 fw-600">{{ translate('Total') }}</th>
|
||||
<td class="text-right">
|
||||
<strong>
|
||||
<span>{{ single_price($order->grand_total) }}
|
||||
</span>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#update_delivery_status').on('change', function() {
|
||||
var order_id = {{ $order->id }};
|
||||
var status = $('#update_delivery_status').val();
|
||||
$.post('{{ route('orders.update_delivery_status') }}', {
|
||||
_token: '{{ @csrf_token() }}',
|
||||
order_id: order_id,
|
||||
status: status
|
||||
}, function(data) {
|
||||
$('#order_details').modal('hide');
|
||||
AIZ.plugins.notify('success', '{{ translate('Order status has been updated') }}');
|
||||
location.reload().setTimeOut(500);
|
||||
});
|
||||
});
|
||||
|
||||
$('#update_payment_status').on('change', function() {
|
||||
var order_id = {{ $order->id }};
|
||||
var status = $('#update_payment_status').val();
|
||||
$.post('{{ route('orders.update_payment_status') }}', {
|
||||
_token: '{{ @csrf_token() }}',
|
||||
order_id: order_id,
|
||||
status: status
|
||||
}, function(data) {
|
||||
$('#order_details').modal('hide');
|
||||
//console.log(data);
|
||||
AIZ.plugins.notify('success', '{{ translate('Payment status has been updated') }}');
|
||||
location.reload().setTimeOut(500);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user