@php use Illuminate\Support\Str; @endphp @extends('layouts/contentLayoutMaster') @section('title', 'Show Order') @section('main-page', 'Orders') @section('sub-page', 'Show Order') @section('main-page-url', route("orders.index")) @section('sub-page-url', route("orders.show",$model->id)) @section('vendor-style') @endsection @section('content')
Order Number: {{ $model->order_number }}
@if($model->status == \App\Enums\Order\StatusEnum::CONFIRMED) @endif @if($model->status == \App\Enums\Order\StatusEnum::PREPARED)
@csrf
@endif
@php $address = $model->orderAddress; @endphp @if($address)
Customer Details
@if($address)
{{ $address->type === 'pickup' ? 'Pickup Details' : 'Shipping Details' }}
{{ $address->type === 'pickup' ? 'Location:' : 'Address:' }}
@if($address?->type === 'pickup') {{ $address?->location_name }}
{{ $address?->state }}, {{ $address->country }} @else {{ $address?->address_line }}, {{ $address->address_label }}
{{ $address?->state }}, {{ $address->country }} @endif
@endif Delivery Instructions:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Estimated delivery time

Tomorrow, 2:00 PM - 4:00 PM
@endif

Order Placed on:

{{ $model->created_at->format('F d, Y') }}

{{ $model->payment_status->label() }}

{{ $model->paymentMethod?->name ?? 'Cash On Delivery' }}

@foreach ($model->orderItems as $orderItem) @php $product = $orderItem->itemable; $isDesign = $orderItem->itemable && get_class($orderItem->itemable) === \App\Models\Design::class; $isTemplate = $orderItem->itemable && get_class($orderItem->itemable) === \App\Models\Template::class; $isDownload = $orderItem->type === \App\Enums\Item\TypeEnum::DOWNLOAD; $orderItemPreview = $orderItem->getFirstMediaUrl('order_item_mockups') ?: $orderItem->getFirstMediaUrl('order_item_previews'); $previewImage = match (true) { filled($orderItemPreview) && !$isDesign => $orderItemPreview, $isDesign && $orderItem->itemable->linked_to_mockup => $orderItem->itemable->getFirstMediaUrl('front-mockup-designs') ?: $orderItem->itemable->getFirstMediaUrl('none-mockup-designs') ?: $orderItem->itemable->getFirstMediaUrl('back-mockup-designs'), $isTemplate => $orderItem->itemable?->getFirstMediaUrl('templates-preview') ?: $orderItem->itemable?->getFirstMediaUrl('templates'), default => $orderItem->itemable?->getFirstMediaUrl( Str::plural(Str::lower(class_basename($orderItem->itemable))) ), }; @endphp
Product
{{ $product->name ?? 'No Product Found' }} {{ $isDownload ? 'Download' : 'Print' }}
Qty: {{ $orderItem->quantity }}
@if($orderItem->color)
Color: {{ $orderItem->color }}
@endif
@if($orderItem->discount_amount > 0)
{{ number_format(($orderItem->sub_total) ?? 0, 2) }}
{{ number_format($orderItem->sub_total - $orderItem->discount_amount ?? 0, 2) }}
-{{ number_format($orderItem->discount_amount, 2) }}
@else
{{ number_format($orderItem->sub_total ?? 0, 2) }}
@endif
{{-- Types / Download Design Area --}} @if($orderItem->itemable?->types)

Designs:

@foreach($orderItem->itemable->types as $type) @php $itemable = $orderItem->itemable; $label = $type->value->label(); $useTemplate = $isDesign && $itemable->template?->approach === 'without_editor'; $downloadUrl = ($useTemplate ? $itemable->template : $itemable)->getImageUrlForType($label); $coloredPreview = null; if ($orderItem->color) { $coloredPreview = $orderItem->getMedia('order_item_previews') ->first(fn($m) => $m->getCustomProperty('type') == $label) ?->getUrl(); } @endphp

{{ $label }} Design

{{ $label }} item photo {{-- Original transparent download --}} Download Design @if($coloredPreview) Download with Color @endif Download Production File with QR
@endforeach
@endif
@endforeach {{--
Product
Product Name 1
Qty: 2
$40.00
--}}
Pricing Details
Subtotal {{ $model->subtotal }}
Discount -{{ $model->discount_amount }}
Delivery {{$model->delivery_amount}}
Tax {{ $model->tax_amount }}

Total {{$model->total_price}}
{{ $model->status->label() }}
@endsection @section('vendor-script') @endsection @section('page-script') @endsection