@extends('layouts.syndron.app') @section('content')
{{-- Header --}}
@if(!empty($product->brand_img)) {{ $product->title }} @else
No image
@endif

{{ $product->title }}

Code: {{ $product->code }} Slug: {{ $product->slug }} Status: {{ __($product->status) }}
{{-- adjust routes to your project --}} Back Edit
{{-- Quick stats --}} @php $uniqueSellersCount = isset($sellers) ? $sellers->count() : ($product->sellers?->unique('id')->count() ?? 0); $inventoriesCount = $product->inventories?->count() ?? 0; $variantsCount = $product->inventoryVariants?->count() ?? 0; $commentsCount = $product->comments?->count() ?? 0; // Safe stock number (your model method handles module multi-shop-seller) $stock = method_exists($product, 'getInventoryCount') ? $product->getInventoryCount() : null; @endphp
Sellers
{{ $uniqueSellersCount }}
Inventories
{{ $inventoriesCount }}
Variants
{{ $variantsCount }}
In Stock
@if($stock === null) ∞ @else {{ number_format($stock) }} @endif
{{-- Tabs --}}
{{-- Product Info --}}
Overview
Category
{{ $product->category->name ?? '-' }}
Brand
{{ $product->brand->name ?? '-' }}
Base Price
{{ number_format($product->price ?? 0) }}
Discount Price
{{ number_format($product->discount_price ?? 0) }}
Off Rate
%{{ $product->off_rate ?? 0 }}
Display Price
{{ $product->display_price }}
Second Hand
{{ $product->second_hand ? 'Yes' : 'No' }}
Consumable
{{ $product->consumable ? 'Yes' : 'No' }}

Short Description
{{ $product->short_description ?: '-' }}
Meta
Created {{ optional($product->created_at)->format('Y-m-d H:i') }}
Updated {{ optional($product->updated_at)->format('Y-m-d H:i') }}
Owner {{ $product->user->name ?? ('#'.$product->user_id) }}

Weight {{ $product->weight ?? '-' }}
Dimensions {{ $product->length ?? '-' }} × {{ $product->width ?? '-' }} × {{ $product->height ?? '-' }}
@if(!empty($product->content))
Content
{!! $product->content !!}
@endif
{{-- Sellers --}}
@php $sellerList = isset($sellers) ? $sellers : ($product->sellers?->unique('id')->values() ?? collect()); @endphp @if($sellerList->isEmpty())
No sellers found for this product.
@else
@foreach($sellerList as $shop) @endforeach
Shop Owner Phone Email Approved
@if(!empty($shop->logo)) {{ $shop->name }} @else
—
@endif
{{ $shop->name }}
{{ $shop->slug }}
{{ $shop->user->name ?? ('#'.$shop->user_id) }} {{ $shop->phone ?? '-' }} {{ $shop->email ?? '-' }} @if($shop->is_approved) Yes @else No @endif
@endif
{{-- Inventories --}}
@if(($product->inventories ?? collect())->isEmpty())
No inventories found for this product.
@else
@foreach($product->inventories as $inv) @php $variants = $inv->variant ?? collect(); // your relation name is "variant()" @endphp

Weight: {{ $inv->weight ?? '-' }}
Size: {{ $inv->size ?? '-' }}
Color: {{ $inv->color ?? '-' }}
Status: {{ __($inv->status) }}
Variants
@if($variants->isEmpty())
No variants for this inventory.
@else
@foreach($variants as $v) @endforeach
SKU Barcode Combination Price Override On hand Status
{{ $v->sku_code ?? '-' }} {{ $v->barcode ?? '-' }} @if(is_array($v->combination_items) && count($v->combination_items)) {{ json_encode($v->combination_items, JSON_UNESCAPED_UNICODE) }} @else - @endif {{ number_format($v->price_override ?? 0) }} {{ optional($v->warehouseInventory)->qty_on_hand ?? '-' }} {{ __($v->status) }}
@endif
@endforeach
@endif
{{-- Orders --}}
@if(empty($orders) || (method_exists($orders, 'count') && $orders->count() === 0))
Orders list is empty (or not connected yet). If you want, send me your OrderItem model and DB fields, I’ll write the exact query to fetch orders that contain this product.
@else
@foreach($orders as $order) @endforeach
Tracking Status Amount Created
{{ $order->tracking_code ?? ('#'.$order->id) }} {{ __($order->status) }} {{ number_format($order->amount ?? 0) }} {{ optional($order->created_at)->format('Y-m-d H:i') }}
{{-- If it's paginator --}} @if(method_exists($orders, 'links'))
{{ $orders->links() }}
@endif @endif
{{-- Comments --}}
@if(($product->comments ?? collect())->isEmpty())
No comments for this product.
@else
@foreach($product->comments->sortByDesc('id') as $c)
{{ $c->name ?: ($c->user->name ?? 'Guest') }} User: {{ $c->user->id ?? '-' }}
Rate: {{ $c->rate ?? '-' }} • Status: {{ __($c->status?->value ?? $c->status) }}
Comment
{{ $c->content }}
@if(!empty($c->good_point) || !empty($c->bad_point))
Good points
{{ $c->good_point ?: '-' }}
Bad points
{{ $c->bad_point ?: '-' }}
@endif
@endforeach
@endif
@endsection