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

{{ __('Edit Product') }}

{{ __('Update product information and SEO settings') }}

{{ __('View Product') }} {{ __('Duplicate') }} {{ __('Back to Products') }}
@endsection @push('styles') @endpush @section('content')
{{-- Product Status Alert --}} @if(!$product->is_active)
{{ __('Product is currently inactive') }} - {{ __('This product is not visible on the website') }}
@endif
@csrf @method('PUT') {{-- Language Tabs for Multi-language Support --}}
@foreach(config('laravellocalization.supportedLocales') as $localeCode => $locale) @php $translation = $product->translations->where('locale', $localeCode)->first(); @endphp
{{-- Basic Product Information --}}
{{ __('Basic Information') }} ({{ $locale['native'] }})
{{ strlen($translation->name ?? '') }} /255 characters
{{ strlen($translation->short_description ?? '') }} /160 characters (recommended for search snippets)
{{-- SEO Meta Information --}}
{{ __('SEO Optimization') }} ({{ $locale['native'] }})
{{-- SEO Score Indicator --}}
SEO Score: 0/100
Needs improvement
{{ strlen($translation->meta_title ?? '') }} /60 characters (optimal: 50-60)
Separate keywords with commas (3-5 keywords recommended)
{{ strlen($translation->meta_description ?? '') }} /160 characters (optimal: 150-160)
{{-- Product Features & Specifications --}}
{{ __('Features & Specifications') }} ({{ $locale['native'] }})
One feature per line, use bullet points
Format: Property: Value (one per line)
@endforeach
{{-- Global Product Data --}}
{{ __('Product Details') }}
$ {{-- ✅ ADD THIS --}}
$ {{-- ✅ ADD THIS --}}
{{-- ✅ ADD: New pricing fields after your existing sale_price field --}}
$
@error('cost_price')
{{ $message }}
@enderror {{ __('For internal profit calculation') }}
%
@error('tax_rate')
{{ $message }}
@enderror
{{-- Close the row --}} {{-- ✅ ADD: Profit Margin Display --}}
{{-- ✅ ADD: Sale Period Management Section (add as new form-section) --}}
{{ __('Sale Period Management') }}
sale_starts_at || $product->sale_ends_at) ? 'checked' : '' }}>
@error('sale_starts_at')
{{ $message }}
@enderror @if($product->sale_starts_at) {{ __('Current') }}: {{ $product->sale_starts_at->format('M d, Y H:i') }} @endif
@error('sale_ends_at')
{{ $message }}
@enderror @if($product->sale_ends_at) {{ __('Current') }}: {{ $product->sale_ends_at->format('M d, Y H:i') }} @endif
{{-- ✅ Sale status indicator --}} @if($product->sale_price)
{{ __('Sale Status') }}: @if($product->isSaleActive()) {{ __('Currently Active') }} @if($product->sale_ends_at) - {{ __('Ends') }}: {{ $product->sale_ends_at->format('M d, Y H:i') }} @endif @else {{ __('Not Active') }} @if($product->sale_starts_at && $product->sale_starts_at->gt(now())) - {{ __('Starts') }}: {{ $product->sale_starts_at->format('M d, Y H:i') }} @elseif($product->sale_ends_at && $product->sale_ends_at->lt(now())) - {{ __('Ended') }}: {{ $product->sale_ends_at->format('M d, Y H:i') }} @endif @endif
@endif
{{-- Categories --}}
{{ __('Product Categories') }}
{{-- Current Categories --}} @if($product->categories->count() > 0)
{{ __('Current Categories') }}: @foreach($product->categories as $category) {{ $category->name }} @endforeach
@endif
@foreach($categories as $category)
categories->contains($category->id) ? 'checked' : '' }}>
@endforeach
{{-- Current Images --}} @if($product->images->count() > 0)
{{ __('Current Images') }}
@foreach($product->images as $image)
{{ $image->alt_text }}
@if(!$image->is_primary) @else @endif
@if($image->is_primary)
{{ __('Primary Image') }}
@endif
@endforeach
@endif {{-- Add New Images --}}
{{ __('Add New Images') }}
Recommended: 800x800px minimum, JPG/PNG format
{{-- ✅ ENHANCE: Status section (find your existing status checkboxes and enhance) --}}
{{ __('Visibility & Status') }}
{{-- ✅ ADD: Product Status --}} {{-- ✅ EXISTING: Active status (enhance) --}}
is_active) ? 'checked' : '' }}>
{{-- ✅ EXISTING: Featured status (enhance) --}}
is_featured) ? 'checked' : '' }}>
{{-- ✅ ADD: COD Eligible --}}
cod_eligible) ? 'checked' : '' }}>
{{-- ✅ EXISTING: Track inventory (keep as-is) --}}
track_inventory) ? 'checked' : '' }}>
@error('status')
{{ $message }}
@enderror {{ __('Current') }}: {{ ucfirst($product->status) }}
{{-- ✅ ADD: Featured Until Field --}} {{-- ✅ ADD: Analytics Display --}} @if($product->views_count > 0)
{{ __('Views') }}: {{ number_format($product->views_count) }}
{{ __('Created') }}: {{ $product->created_at->diffForHumans() }}
@endif
{{-- ✅ ENHANCED: Form Actions --}}
{{ __('Back to Products') }}
@if($product->status !== 'published') @endif @if($product->status === 'published') @endif
@endsection @push('scripts') {{-- ✅ ADD: Enhanced JavaScript --}} {{-- @endpushdraft" class="btn btn-outline-primary me-2">--}} {{-- --}} {{-- {{ __('Save as Draft') }}--}} {{-- --}} {{--