order history
This commit is contained in:
parent
fa00ee377a
commit
f1e0577bef
|
|
@ -190,7 +190,11 @@ class CheckoutController extends Controller
|
|||
->first();
|
||||
$invoice_url = $payment ? @$payment->method->invoice_url: "";
|
||||
|
||||
return redirect()->to($invoice_url);
|
||||
return redirect()->to($invoice_url)->withHeaders([
|
||||
'Cache-Control' => 'no-cache, no-store, must-revalidate',
|
||||
'Pragma' => 'no-cache',
|
||||
'Expires' => '0'
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
||||
$orders = Transaction::where('user_id', auth()->user()->id)
|
||||
->orderBy('id','desc')
|
||||
->paginate();
|
||||
|
||||
return view('account.orders', compact('orders'));
|
||||
}
|
||||
}
|
||||
|
|
@ -98,4 +98,10 @@ class Transaction extends Model
|
|||
return $this->belongsTo(PosInvoice::class, 'invoice_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTitleAttribute()
|
||||
{
|
||||
return __('order.status.'.strtolower($this->attributes['status']));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'order' => [
|
||||
'status' => [
|
||||
'wait_payment' => 'Wait Payment',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'order' => [
|
||||
'status' => [
|
||||
'wait_payment' => 'Menunggu Pembayaran',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
@ -78,283 +78,60 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-body-emphasis orders-list">
|
||||
<!-- Item -->
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">78A6431D409</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>Feb 6, 2025</li>
|
||||
<li class="d-flex align-items-center">
|
||||
@foreach ($orders as $key => $order)
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">{{ $order->number }}</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>{{ \Carbon\Carbon::parse($order->created_at)->format('d M Y') }}</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<span class="bg-info rounded-circle p-1 me-2"></span>
|
||||
{{ $order->status_title }}
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">Rp
|
||||
{{ number_format($order->subtotal, 0, ',', '.') }}</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
{{ \Carbon\Carbon::parse($order->created_at)->format('d M Y') }}
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-info rounded-circle p-1 me-2"></span>
|
||||
In progress
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">$2,105.90</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
Feb 6, 2025
|
||||
<span class="date d-none">25-02-06</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-info rounded-circle p-1 me-2"></span>
|
||||
In progress
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
$2,105.90
|
||||
<span class="total d-none">210590</span>
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/20.png"
|
||||
width="64" /></span>
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/16.png"
|
||||
width="64" /></span>
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/15.png"
|
||||
width="64" /></span>
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Item -->
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">47H76G09F33</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>Dec 12, 2024</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<span class="bg-success rounded-circle p-1 me-2"></span>
|
||||
Delivered
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">$360.75</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
Dec 12, 2024
|
||||
<span class="date d-none">24-12-12</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-success rounded-circle p-1 me-2"></span>
|
||||
Delivered
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
$360.75
|
||||
<span class="total d-none">36075</span>
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/14.png"
|
||||
width="64" /></span>
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Item -->
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">502TR872W2</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>Nov 7, 2024</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<span class="bg-success rounded-circle p-1 me-2"></span>
|
||||
Delivered
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">$4,268.00</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
Nov 7, 2024
|
||||
<span class="date d-none">24-11-07</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-success rounded-circle p-1 me-2"></span>
|
||||
Delivered
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
$4,268.00
|
||||
<span class="total d-none">426800</span>
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/12.png"
|
||||
width="64" /></span>
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/13.png"
|
||||
width="64" /></span>
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/18.png"
|
||||
width="64" /></span>
|
||||
<span class="fw-medium me-1">+3</span>
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Item -->
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">34VB5540K83</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>Sep 15, 2024</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<span class="bg-danger rounded-circle p-1 me-2"></span>
|
||||
Canceled
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">$987.50</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
Sep 15, 2024
|
||||
<span class="date d-none">24-09-15</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-danger rounded-circle p-1 me-2"></span>
|
||||
Canceled
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
$987.50
|
||||
<span class="total d-none">98750</span>
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/21.png"
|
||||
width="64" /></span>
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/11.png"
|
||||
width="64" /></span>
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Item -->
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">112P45A90V2</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>May 12, 2024</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<span class="bg-success rounded-circle p-1 me-2"></span>
|
||||
Delivered
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">$53.00</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
May 12, 2024
|
||||
<span class="date d-none">24-05-12</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-success rounded-circle p-1 me-2"></span>
|
||||
Delivered
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
$53.00
|
||||
<span class="total d-none">5300</span>
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/17.png"
|
||||
width="64" /></span>
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- Item -->
|
||||
<tr>
|
||||
<td class="fw-medium pt-2 pb-3 py-md-2 ps-0">
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="d-inline-block animate-underline text-body-emphasis text-decoration-none py-2"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<span class="animate-target">28BA67U0981</span>
|
||||
</a>
|
||||
<ul class="list-unstyled fw-normal text-body m-0 d-md-none">
|
||||
<li>Apr 20, 2024</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<span class="bg-danger rounded-circle p-1 me-2"></span>
|
||||
Canceled
|
||||
</li>
|
||||
<li class="fw-medium text-body-emphasis">$1,029.50</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
Apr 20, 2024
|
||||
<span class="date d-none">24-04-20</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
<span class="d-flex align-items-center">
|
||||
<span class="bg-danger rounded-circle p-1 me-2"></span>
|
||||
Canceled
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
$1,029.50
|
||||
<span class="total d-none">102950</span>
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/19.png"
|
||||
width="64" /></span>
|
||||
<span><img alt="Thumbnail" src="/img/shop/electronics/thumbs/22.png"
|
||||
width="64" /></span>
|
||||
<a aria-controls="orderDetails" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{{ $order->status_title }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="fw-medium py-3 d-none d-md-table-cell">
|
||||
Rp {{ number_format($order->subtotal, 0, ',', '.') }}
|
||||
</td>
|
||||
<td class="py-3 pe-0">
|
||||
<span
|
||||
class="d-flex align-items-center justify-content-end position-relative gap-1 gap-sm-2 ms-n2 ms-sm-0">
|
||||
|
||||
|
||||
@foreach ($order->details->take(3) as $detail)
|
||||
<span><img alt="Thumbnail" src="{{ $detail->reference->item->image_url ?? '' }}"
|
||||
width="50" /></span>
|
||||
@endforeach
|
||||
@if ($order->details->count() > 3)
|
||||
<span class="fw-medium me-1">+{{ $order->details->count() - 3 }}</span>
|
||||
@endif
|
||||
<a aria-controls="orderDetails_{{ $order->id }}" aria-label="Show order details"
|
||||
class="btn btn-icon btn-ghost btn-secondary stretched-link border-0"
|
||||
data-bs-toggle="offcanvas" href="#orderDetails_{{ $order->id }}">
|
||||
<i class="ci-chevron-right fs-lg"></i>
|
||||
</a>
|
||||
|
||||
<x-order.details :order="$order ?? null" />
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -382,5 +159,5 @@
|
|||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@section('scripts')
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -0,0 +1,149 @@
|
|||
@props(['order' => null])
|
||||
|
||||
<div class="offcanvas offcanvas-end pb-sm-2 px-sm-2" id="orderDetails_{{ $order->id }}" tabindex="-1" aria-labelledby="orderDetailsLabel"
|
||||
style="width: 500px" aria-modal="true" role="dialog">
|
||||
|
||||
<!-- Header -->
|
||||
<div class="offcanvas-header align-items-start py-3 pt-lg-4">
|
||||
<div>
|
||||
<h4 class="offcanvas-title mb-1" id="orderDetailsLabel">
|
||||
Order # {{ $order?->number ?? '78A6431D409' }}
|
||||
</h4>
|
||||
<span class="d-flex align-items-center fs-sm fw-medium text-body-emphasis">
|
||||
<span class="bg-info rounded-circle p-1 me-2"></span>
|
||||
{{ $order?->status_title ?? 'In progress' }}
|
||||
</span>
|
||||
</div>
|
||||
<button type="button" class="btn-close mt-0" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<!-- Body -->
|
||||
<div class="offcanvas-body d-flex flex-column gap-4 pt-2 pb-3">
|
||||
|
||||
<!-- Items -->
|
||||
<div class="d-flex flex-column gap-3">
|
||||
@if($order && $order->details)
|
||||
@foreach ($order->details as $detail)
|
||||
<div class="d-flex align-items-center">
|
||||
<a class="flex-shrink-0" href="{{ route('product.detail', $detail->reference->item->slug ?? '#') }}">
|
||||
<img src="{{ $detail->reference->item->image_url ?? '/img/shop/electronics/thumbs/01.png' }}"
|
||||
width="110" alt="{{ $detail->reference->item->name ?? 'Product' }}">
|
||||
</a>
|
||||
<div class="w-100 min-w-0 ps-2 ps-sm-3">
|
||||
<h5 class="d-flex animate-underline mb-2">
|
||||
<a class="d-block fs-sm fw-medium text-truncate animate-target"
|
||||
href="{{ route('product.detail', $detail->reference->item->slug ?? '#') }}">
|
||||
{{ $detail->reference->item->name ?? 'Product Name' }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="h6 mb-2">Rp {{ number_format($detail->price ?? 0, 0, ',', '.') }}</div>
|
||||
<div class="fs-xs">Qty: {{ $detail->qty ?? 1 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<!-- Default items for demo -->
|
||||
<div class="d-flex align-items-center">
|
||||
<a class="flex-shrink-0" href="shop-product-general-electronics.html">
|
||||
<img src="assets/img/shop/electronics/thumbs/01.png" width="110" alt="Smart Watch">
|
||||
</a>
|
||||
<div class="w-100 min-w-0 ps-2 ps-sm-3">
|
||||
<h5 class="d-flex animate-underline mb-2">
|
||||
<a class="d-block fs-sm fw-medium text-truncate animate-target"
|
||||
href="shop-product-general-electronics.html">Smart Watch Series 7, White</a>
|
||||
</h5>
|
||||
<div class="h6 mb-2">$429.00</div>
|
||||
<div class="fs-xs">Qty: 1</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<a class="flex-shrink-0" href="shop-product-general-electronics.html">
|
||||
<img src="assets/img/shop/electronics/thumbs/08.png" width="110" alt="iPhone 14">
|
||||
</a>
|
||||
<div class="w-100 min-w-0 ps-2 ps-sm-3">
|
||||
<h5 class="d-flex animate-underline mb-2">
|
||||
<a class="d-block fs-sm fw-medium text-truncate animate-target"
|
||||
href="shop-product-general-electronics.html">Apple iPhone 14 128GB White</a>
|
||||
</h5>
|
||||
<div class="h6 mb-2">$899.00</div>
|
||||
<div class="fs-xs">Qty: 1</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<a class="flex-shrink-0" href="shop-product-general-electronics.html">
|
||||
<img src="assets/img/shop/electronics/thumbs/09.png" width="110" alt="iPad Pro">
|
||||
</a>
|
||||
<div class="w-100 min-w-0 ps-2 ps-sm-3">
|
||||
<h5 class="d-flex animate-underline mb-2">
|
||||
<a class="d-block fs-sm fw-medium text-truncate animate-target"
|
||||
href="shop-product-general-electronics.html">Tablet Apple iPad Pro M2</a>
|
||||
</h5>
|
||||
<div class="h6 mb-2">$989.00</div>
|
||||
<div class="fs-xs">Qty: 1</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Delivery + Payment info -->
|
||||
<div class="border-top pt-4">
|
||||
<h6>Delivery</h6>
|
||||
<ul class="list-unstyled fs-sm mb-4">
|
||||
<li class="d-flex justify-content-between mb-1">
|
||||
Estimated delivery date:
|
||||
<span class="text-body-emphasis fw-medium text-end ms-2">
|
||||
{{ $order?->estimated_delivery_date ?? 'Feb 8, 2025 / 10:00 - 12:00' }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="d-flex justify-content-between mb-1">
|
||||
Shipping method:
|
||||
<span class="text-body-emphasis fw-medium text-end ms-2">
|
||||
{{ $order?->courier_company ?? 'Courier delivery' }} {{ $order?->courier_type ?? '' }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="d-flex justify-content-between">
|
||||
Shipping address:
|
||||
<span class="text-body-emphasis fw-medium text-end ms-2">
|
||||
{{ $order?->address?->location ?? '567 Cherry Lane Apt B12,<br>Harrisburg' }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h6>Payment</h6>
|
||||
<ul class="list-unstyled fs-sm m-0">
|
||||
<li class="d-flex justify-content-between mb-1">
|
||||
Payment method:
|
||||
<span class="text-body-emphasis fw-medium text-end ms-2">
|
||||
{{ $order?->payment_method ?? 'Cash on delivery' }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="d-flex justify-content-between mb-1">
|
||||
Tax collected:
|
||||
<span class="text-body-emphasis fw-medium text-end ms-2">
|
||||
Rp {{ number_format($order?->tax ?? 0, 0, ',', '.') }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="d-flex justify-content-between">
|
||||
Shipping:
|
||||
<span class="text-body-emphasis fw-medium text-end ms-2">
|
||||
Rp {{ number_format($order?->shipping_cost ?? 0, 0, ',', '.') }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Total -->
|
||||
<div class="d-flex align-items-center justify-content-between fs-sm border-top pt-4">
|
||||
Estimated total:
|
||||
<span class="h5 text-end ms-2 mb-0">
|
||||
Rp {{ number_format($order?->total ?? 210590, 0, ',', '.') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="offcanvas-header">
|
||||
<a class="btn btn-lg btn-secondary w-100" href="#!">Change the delivery time</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
<div class="offcanvas-body d-block pt-2 pt-lg-4 pb-lg-0">
|
||||
<nav class="list-group list-group-borderless">
|
||||
<a class="list-group-item list-group-item-action d-flex align-items-center"
|
||||
href="{{ route('second', ['account', 'orders']) }}">
|
||||
href="{{ route('orders') }}">
|
||||
<i class="ci-shopping-bag fs-base opacity-75 me-2"></i>
|
||||
{{ __('account_sidebar.orders') }}
|
||||
<span class="badge bg-primary rounded-pill ms-auto">1</span>
|
||||
|
|
|
|||
|
|
@ -3,25 +3,26 @@
|
|||
use App\Http\Controllers\Auth\AddressController;
|
||||
use App\Http\Controllers\Auth\LoginEmailController;
|
||||
use App\Http\Controllers\Auth\LoginWaController;
|
||||
use App\Http\Controllers\Auth\RegisterController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\RoutingController;
|
||||
use App\Http\Controllers\LocationController;
|
||||
use App\Http\Controllers\LocaleController;
|
||||
use App\Http\Controllers\ProductController;
|
||||
use App\Http\Controllers\SearchController;
|
||||
use App\Http\Controllers\ComponentController;
|
||||
use App\Http\Controllers\Auth\ProfileController;
|
||||
use App\Http\Controllers\Auth\RegisterController;
|
||||
use App\Http\Controllers\CartController;
|
||||
use App\Http\Controllers\CheckoutController;
|
||||
use App\Http\Controllers\ComponentController;
|
||||
use App\Http\Controllers\HomeController;
|
||||
use App\Http\Controllers\LocaleController;
|
||||
use App\Http\Controllers\LocationController;
|
||||
use App\Http\Controllers\OrderController;
|
||||
use App\Http\Controllers\ProductController;
|
||||
use App\Http\Controllers\RoutingController;
|
||||
use App\Http\Controllers\SearchController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['prefix' => '/dummy'], function () {
|
||||
Route::get('', [RoutingController::class, 'index'])->name('root');
|
||||
Route::get('{first}/{second}/{third}', [RoutingController::class, 'thirdLevel'])->name('third');
|
||||
Route::get('{first}/{second}', [RoutingController::class, 'secondLevel'])->name('second');
|
||||
Route::get('{any}', [RoutingController::class, 'root'])->name('any');
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Location selection route
|
||||
|
|
@ -32,14 +33,14 @@ Route::post('/locale/switch', [LocaleController::class, 'switch'])->name('locale
|
|||
|
||||
Route::get('/', [HomeController::class, 'index'])->name('home');
|
||||
|
||||
Route::get('/products',[ProductController::class, 'index'])->name('product.index');
|
||||
Route::get('/products/ajax',[ProductController::class, 'ajax'])->name('product.ajax');
|
||||
Route::get('/products/ajax/highlights',[ProductController::class, 'highlights'])->name('product.ajax.highlights');
|
||||
Route::get('/products/ajax/brands',[ProductController::class, 'brands'])->name('product.ajax.brands');
|
||||
Route::get('/products/ajax/categories',[ProductController::class, 'categories'])->name('product.ajax.categories');
|
||||
Route::get('/products/ajax/genders',[ProductController::class, 'genders'])->name('product.ajax.genders');
|
||||
Route::get('/products/ajax/announcements',[ProductController::class, 'announcements'])->name('product.ajax.announcements');
|
||||
Route::get('/product/{slug}',[ProductController::class, 'detail'])->name('product.detail');
|
||||
Route::get('/products', [ProductController::class, 'index'])->name('product.index');
|
||||
Route::get('/products/ajax', [ProductController::class, 'ajax'])->name('product.ajax');
|
||||
Route::get('/products/ajax/highlights', [ProductController::class, 'highlights'])->name('product.ajax.highlights');
|
||||
Route::get('/products/ajax/brands', [ProductController::class, 'brands'])->name('product.ajax.brands');
|
||||
Route::get('/products/ajax/categories', [ProductController::class, 'categories'])->name('product.ajax.categories');
|
||||
Route::get('/products/ajax/genders', [ProductController::class, 'genders'])->name('product.ajax.genders');
|
||||
Route::get('/products/ajax/announcements', [ProductController::class, 'announcements'])->name('product.ajax.announcements');
|
||||
Route::get('/product/{slug}', [ProductController::class, 'detail'])->name('product.detail');
|
||||
|
||||
// Search routes
|
||||
Route::get('/search', [SearchController::class, 'search'])->name('search.ajax');
|
||||
|
|
@ -53,7 +54,7 @@ Route::post('/register', [RegisterController::class, 'register'])->name('registe
|
|||
Route::get('/login', [LoginWaController::class, 'index'])->name('login');
|
||||
Route::group(['prefix' => '/login/phone'], function () {
|
||||
Route::get('/', [LoginWaController::class, 'index'])->name('login-phone');
|
||||
Route::post('/otp', [LoginWaController::class,'otp'])->name('login-phone.otp');
|
||||
Route::post('/otp', [LoginWaController::class, 'otp'])->name('login-phone.otp');
|
||||
Route::get('/otp/{identity}', [LoginWaController::class, 'otpView'])->name('login-phone.otp.view');
|
||||
Route::post('/verify', [LoginWaController::class, 'verify'])->name('login-phone.verify');
|
||||
});
|
||||
|
|
@ -87,7 +88,6 @@ Route::middleware(['auth'])->prefix('/addresses')->group(function () {
|
|||
Route::get('/villages/{districtId}', [AddressController::class, 'villages'])->name('addresses.villages');
|
||||
});
|
||||
|
||||
|
||||
Route::middleware(['auth'])->prefix('/cart')->group(function () {
|
||||
Route::get('/', [CartController::class, 'index'])->name('cart.index');
|
||||
Route::post('/', [CartController::class, 'add'])->name('cart.add');
|
||||
|
|
@ -98,13 +98,18 @@ Route::middleware(['auth'])->prefix('/cart')->group(function () {
|
|||
});
|
||||
|
||||
Route::middleware(['auth'])->prefix('/checkout')->group(function () {
|
||||
|
||||
|
||||
|
||||
Route::get('/', [CheckoutController::class, 'index'])->name('checkout.delivery');
|
||||
Route::post('/', [CheckoutController::class, 'indexProcess'])->name('checkout.delivery.process');
|
||||
|
||||
Route::get('/shipping', [CheckoutController::class, 'chooseShipping'])->name('checkout.shipping');
|
||||
Route::post('/shipping', [CheckoutController::class, 'chooseShippingProcess'])->name('checkout.shipping.process');
|
||||
Route::get('/payment', [CheckoutController::class, 'choosePayment'])->name('checkout.payment');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Route::middleware(['auth'])->prefix('/orders')->group(function () {
|
||||
|
||||
Route::get('/', [OrderController::class, 'index'])->name('orders');
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue