@include('navbar/nav')
@csrf
@if(session('error'))
{{ session('error') }}
@endif

Edit Product Information

Manage Global Attributes
@if($data->small_image)Current: {{ $data->small_image }}@endif
@if($data->medium_image)Current: {{ $data->medium_image }}@endif
@if($data->large_image)Current: {{ $data->large_image }}@endif
@php $existingAttrIds = $data->variantAttributes->pluck('product_attribute_id')->toArray(); $requiredMap = $data->variantAttributes->pluck('is_required', 'product_attribute_id')->toArray(); @endphp
Product Variants & Options

Update enabled variant attributes and stock matrix for this product.

Step 1: Applicable Attributes
@foreach($attributes as $attr) @php $isSel = in_array($attr->id, $existingAttrIds); @endphp
{{ strtoupper($attr->type) }}
id]) && $requiredMap[$attr->id] ? 'checked' : '' }} title="Required Choice">
@endforeach
Step 2: Attribute Values
@foreach($attributes as $attr) @if($attr->type !== 'text_input') @php $isAttrSel = in_array($attr->id, $existingAttrIds); // find all value IDs currently used in product variants for this attribute $usedValIds = []; foreach($data->variants as $var) { foreach($var->values as $vv) { if($vv->product_attribute_id == $attr->id) { $usedValIds[] = $vv->product_attribute_value_id; } } } $usedValIds = array_unique($usedValIds); @endphp
{{ $attr->name }} Values:
@foreach($attr->values as $val) @php $isValChecked = in_array($val->id, $usedValIds); @endphp
@endforeach
@endif @endforeach
Step 3: Variant Combination Matrix
@foreach($data->variants as $idx => $var) @php $labels = []; $valIdsArr = []; foreach($var->values as $vv) { if($vv->attribute && $vv->attributeValue) { $labels[] = $vv->attribute->name . ': ' . $vv->attributeValue->value; $valIdsArr[] = $vv->product_attribute_value_id; } } $comboLabelsStr = implode(' | ', $labels); $valIdsStr = implode(',', $valIdsArr); @endphp @endforeach
Combination SKU Price Override ($) Stock Quantity Active Variant Image
{{ $comboLabelsStr ?: 'Default Option' }}
is_active ? 'checked' : '' }}>
@if($var->image)Current: {{ $var->image }}@endif
Cancel
@include('footerbar/footer') @include('navbar/sidebar') @include('java/java-script')