@extends('layouts.app') @section('title', __('My Orders')) @php /* * Use the currency selected in Payment Settings throughout * this page and its financial partials. */ $displayCurrency = currency_code( $currency ?? default_currency() ); $search = trim( (string) ($search ?? request('q', '')) ); $paymentStatus = (string) ( $paymentStatus ?? request('payment_status', 'all') ); $orderStatus = (string) ( $orderStatus ?? request('order_status', 'all') ); $sort = (string) ( $sort ?? request('sort', 'latest') ); if ( ! in_array( $sort, ['latest', 'oldest', 'total_high', 'total_low'], true ) ) { $sort = 'latest'; } $allowedPerPage = [10, 20, 30, 50]; $perPage = (int) ( $perPage ?? request('per_page', 10) ); if (! in_array($perPage, $allowedPerPage, true)) { $perPage = 10; } $dateFrom = trim( (string) request('date_from', '') ); $dateTo = trim( (string) request('date_to', '') ); $hasFilters = $search !== '' || $paymentStatus !== 'all' || $orderStatus !== 'all' || $sort !== 'latest' || $perPage !== 10 || $dateFrom !== '' || $dateTo !== ''; $pendingPaymentStatus = \App\Models\Order::PAYMENT_PENDING; $receivedPaymentStatus = \App\Models\Order::PAYMENT_RECEIVED; @endphp @section('content')
{{ __( 'Track and manage all your orders in one place.' ) }}
@if($hasFilters) {{ __( 'Try adjusting your search or filter criteria.' ) }} @else {{ __('Start shopping to see your orders here.') }} @endif
@if($hasFilters) {{ __('Clear Filters') }} @elseif( \Illuminate\Support\Facades\Route::has( 'storefront.products.index' ) ) {{ __('Browse Products') }} @endif