@extends('admin.layouts.app') @section('title', 'View Product') @section('breadcrumb') @endsection @section('page-header')

{{ $product->name }}

{{ __('SKU') }}: {{ $product->sku }} @if($product->brand) • {{ $product->brand }} @endif • ID: #{{ $product->id }}

{{ __('Edit Product') }}
@endsection @push('styles') @endpush @section('content')
{{ $product->is_active ? __('Active') : __('Inactive') }}
@if($product->is_featured) @endif

{{ $product->name }}

{{ $product->sku }} @if($product->brand) {{ $product->brand }} @endif {{ $product->created_at->format('M d, Y') }}
@php $basePrice = $product->sale_price ?: $product->price; // $vatAmount = $basePrice * .15; $vatAmount = $basePrice * ($product->tax_rate/100); $customerPrice = $basePrice + $vatAmount; @endphp
{{__('Customer Price')}}: ${{number_format($customerPrice,0)}}
{{-- @if($product->sale_price)--}} {{-- ${{ number_format($product->sale_price, 2) }}--}} {{-- @else--}} {{-- ${{ number_format($product->price, 2) }}--}} {{-- @endif--}} {{__('Base Price')}}: ${{number_format($basePrice,0)}}
@if($product->sale_price)
${{ number_format($product->price, 2) }} -{{ round((($product->price - $product->sale_price) / $product->price) * 100) }}%
@endif
{{ __('Product Overview') }}
@if($product->track_inventory) @if($product->quantity > $product->min_quantity)
{{ __('In Stock') }}
{{ $product->quantity }} {{ __('available') }}
@elseif($product->quantity > 0)
{{ __('Low Stock') }}
{{ $product->quantity }} {{ __('remaining') }}
@else
{{ __('Out of Stock') }}
{{ __('Restock needed') }}
@endif @else
{{ __('Stock not tracked') }}
{{ __('Unlimited availability') }}
@endif
@if($product->categories->count() > 0)
{{ __('Categories') }}:
@foreach($product->categories as $category) {{ $category->name }} @endforeach
@endif
@if($product->brand)
{{ __('Brand') }} {{ $product->brand }}
@endif @if($product->model)
{{ __('Model') }} {{ $product->model }}
@endif @if($product->weight)
{{ __('Weight') }} {{ $product->weight }}kg
@endif
{{ __('Min Quantity') }} {{ $product->min_quantity ?? 'Not set' }}
{{ $product->views_count ?? 0 }} {{ __('Views') }}
0 {{ __('Orders') }}
0 {{ __('Wishlist') }}
{{ $product->translations->count() }}/{{ count(config('laravellocalization.supportedLocales')) }} {{ __('Translations') }}
@foreach(config('laravellocalization.supportedLocales') as $localeCode => $locale) @php $translation = $product->translations->where('locale', $localeCode)->first(); @endphp
{{ $locale['native'] }} @if($translation) @else @endif
@endforeach
@foreach(config('laravellocalization.supportedLocales') as $localeCode => $locale) @php $translation = $product->translations->where('locale', $localeCode)->first(); @endphp
@if($translation) @if($translation->short_description)
{{ __('Short Description') }}

{{ $translation->short_description }}

@endif @if($translation->description)
{{ __('Description') }}
{!! nl2br(e($translation->description)) !!}
@endif @if($translation->features)
{{ __('Features') }}
    @foreach(explode("\n", $translation->features) as $feature) @if(trim($feature))
  • {{ trim(str_replace(['•', '-', '*'], '', $feature)) }}
  • @endif @endforeach
@endif @if($translation->specifications)
{{ __('Specifications') }}
    @foreach(explode("\n", $translation->specifications) as $spec) @if(trim($spec) && strpos($spec, ':') !== false) @php [$key, $value] = explode(':', $spec, 2); @endphp
  • {{ trim($key) }}: {{ trim($value) }}
  • @endif @endforeach
@endif @if($translation->meta_title || $translation->meta_description)
{{ __('SEO Preview') }}
{{ $translation->meta_title ?: $translation->name }}
{{ url('/products/' . $translation->slug) }}
{{ $translation->meta_description ?: ($translation->short_description ?: Str::limit(strip_tags($translation->description), 160)) }}
@if($translation->meta_keywords)
{{ __('Keywords') }}:
@foreach(explode(',', $translation->meta_keywords) as $keyword) {{ trim($keyword) }} @endforeach
@endif
@endif @else
{{ __('Translation Not Available') }}

{{ __('This product has not been translated to') }} {{ $locale['native'] }}

{{ __('Add Translation') }}
@endif
@endforeach
{{ __('System Information') }}
{{ __('Product ID') }}: #{{ $product->id }}
{{ __('SKU') }}: {{ $product->sku }}
@if($product->code)
{{ __('Product Code') }}: {{ $product->code }}
@endif
{{ __('Created At') }}: {{ $product->created_at->format('M d, Y H:i') }}
{{ __('Last Updated') }}: {{ $product->updated_at->format('M d, Y H:i') }}
{{ __('Default Locale') }}: {{ strtoupper($product->default_locale ?? 'ar') }}
{{ __('Quick Actions') }}
@endsection @push('scripts') @endpush