@extends('backend.layouts.layout') @section('content')

Edit Product

@csrf @method('PUT')

Product Information

@error('name')
{{ $message }}
@enderror
SKU code is auto-generated and cannot be changed @error('sku_code')
{{ $message }}
@enderror
@error('short_description')
{{ $message }}
@enderror
@error('description')
{{ $message }}
@enderror

Pricing Information

@error('price')
{{ $message }}
@enderror
@error('compare_price')
{{ $message }}
@enderror
@error('cost_price')
{{ $message }}
@enderror

Attributes & Specifications (Optional)

@php $attributes = $product->attributes ? json_decode($product->attributes, true) : []; $oldAttributes = old('attribute_name', []); @endphp @if(count($oldAttributes) > 0) @foreach($oldAttributes as $key => $value)
@error('attribute_name.'.$key)
{{ $message }}
@enderror
@error('attribute_value.'.$key)
{{ $message }}
@enderror
@endforeach @elseif(count($attributes) > 0) @foreach($attributes as $index => $attribute)
@endforeach @else
@endif
@php $specifications = $product->specifications ? json_decode($product->specifications, true) : []; $oldSpecifications = old('specification_name', []); @endphp @if(count($oldSpecifications) > 0) @foreach($oldSpecifications as $key => $value)
@error('specification_name.'.$key)
{{ $message }}
@enderror
@error('specification_value.'.$key)
{{ $message }}
@enderror
@endforeach @elseif(count($specifications) > 0) @foreach($specifications as $index => $specification)
@endforeach @else
@endif

Categories & Brand

@error('category_id') {{ $message }} @enderror
@error('child_category_id') {{ $message }} @enderror If you select a sub category, the subcategory will be under that. Otherwise, it will be under the main category.
@error('brand_id')
{{ $message }}
@enderror

Product Status

@error('status')
{{ $message }}
@enderror
is_featured) ? 'checked' : '' }}>
is_trending) ? 'checked' : '' }}>

Color Variations with Stock & Images (Optional)

@php $colorVariations = $product->color_variations ?? []; $oldColorVariations = old('color_variations', []); @endphp @if(count($oldColorVariations) > 0) @foreach($oldColorVariations as $key => $variation)
Color Variation #{{ $key + 1 }}
@error('color_variations.'.$key.'.hex')
{{ $message }}
@enderror
@error('color_variations.'.$key.'.name')
{{ $message }}
@enderror
@error('color_variations.'.$key.'.stock_quantity')
{{ $message }}
@enderror
Single image for this color variation (max 2MB) @error('color_variations.'.$key.'.image')
{{ $message }}
@enderror @if(isset($variation['image_path']) && $variation['image_path']) @endif
@if(isset($variation['image_path']) && $variation['image_path']) @endif
@endforeach @elseif(count($colorVariations) > 0) @foreach($colorVariations as $key => $variation)
Color Variation #{{ $key + 1 }}
Single image for this color variation (max 2MB) @if(isset($variation['image_path']) && $variation['image_path']) @endif
@if(isset($variation['image_path']) && $variation['image_path']) @endif
@endforeach @else
Color Variation #1
Single image for this color variation (max 2MB)
@endif
Add different color variations with their own stock quantities and single image
@endsection @push('scripts') @endpush