@extends('layouts.front.home') @section('title') {{ $product->name ?? __('vendor/products.show_page_title') }} - Vendor | Hema @endsection @section('css') @endsection @section('content')
{{-- Breadcrumb --}}
{{ __('vendor/products.hero_title') }} › {{ $product->name ?? '' }}
{{-- Top --}}
{{-- Images --}}
@php $firstImg = null; if(isset($images) && count($images)) $firstImg = $images[0]; elseif(!empty($product->img)) $firstImg = $product->img; $toStorageUrl = function ($path) { $p = ltrim((string) $path, '/'); if (!str_starts_with($p, 'http') && !str_contains($p, '/')) { $p = 'products/' . $p; } if (str_starts_with((string) $path, 'http')) { return (string) $path; } // Prefer Laravel public disk path if (file_exists(storage_path('app/public/' . $p))) { return asset('storage/' . $p); } // Fallback for hosts storing files directly under public/ if (file_exists(public_path($p))) { return asset($p); } return asset('storage/' . $p); }; $placeholderImage = asset('front/assets/images/emptyproducts.png'); @endphp @if($firstImg) {{ $product->name }} @else
@endif
@php $thumbs = []; if(isset($images) && count($images)) $thumbs = $images; elseif(!empty($product->img)) $thumbs = [$product->img]; @endphp @if(count($thumbs))
@foreach($thumbs as $idx => $img)
thumb
@endforeach
@endif
{{-- Info --}}

{{ $product->name ?? '' }}

{{ __('vendor/products.description') }}

{{ $product->desc ?? '-' }}

{{ __('vendor/products.stock') }}: {{ (int)($product->stock_quantity ?? 0) }} {{ __('vendor/products.units') }}
{{-- Vendor mini card (optional) --}}

{{ $product->provider->name ?? 'Vendor' }}

{{ $product->provider->location ?? '-' }}

{{ number_format((float)($product->price ?? 0), 0) }} {{ app()->getLocale()=='ar' ? __('products.currency_sar') : 'SAR' }}
{{ __('vendor/products.edit_product') }}
@csrf @method('DELETE')
{{ __('vendor/products.manage_images') }}
{{-- Tabs --}}
{{-- Specifications --}}
{{ __('vendor/products.spec_power') }}:
{{ $product->power ?? '-' }}
{{ __('vendor/products.spec_weight') }}:
{{ $product->weight ?? '-' }}
Registration Type:
{{ strtoupper((string)($product->registration_type ?? '-')) }}
Registration Number:
{{ $product->registration_number ?? '-' }}
Registration Expiry:
{{ optional($product->registration_expiry_date)->format('Y-m-d') ?? '-' }}
Factory Name:
{{ $product->factory_name ?? '-' }}
Factory Country:
{{ $product->factory_country ?? '-' }}
UOM:
{{ $product->uom ?? '-' }}
Product PDF:
@if($product->product_pdf)View@else-@endif
Registration Certificate:
@if($product->guarantee_file)View@else-@endif
{{-- Reviews --}}
@endsection @section('script') @endsection