@extends('layouts/contentLayoutMaster') @php $dimensions = \App\Models\Dimension::query() ->where('is_custom', false) ->orWhereHas('categories', function ($q) use ($model) { $q->where('dimensionable_id', $model->id)->where('dimensionable_type', get_class($model)); }) ->get(['id', 'name']); $variantsForJs = $model->variants->mapWithKeys(function ($variant) { $media = $variant->media->first(); return [ $variant->key => [ 'id' => $variant->id, 'image' => $media?->id, 'image_url' => $media?->original_url, ] ]; }); $specs = $model->specifications ->filter(fn($spec) => ! in_array($spec->fixed_key, ['frame_model', 'tableau_size', 'frame_color'], true)) ->map(function ($spec) { return [ 'name' => $spec->getTranslation('name', 'en'), 'options' => $spec->options ->map(fn($opt) => $opt->getTranslation('value', 'en')) ->filter() ->values() ->toArray(), ]; }) ->filter(fn($row) => !empty($row['name']) && count($row['options'])) ->values(); @endphp @section('title', 'Edit Products') @section('main-page', 'Products') @section('sub-page', 'Edit Product') @section('main-page-url', route("categories.index")) @section('sub-page-url', route("categories.edit",$model->id)) @section('vendor-style') @endsection @section('content')
@csrf @method("PUT") {{-- checkbox added --}}
show_add_cart_btn ?? false))>
Show “Add to Cart” Button

When the checkbox is selected, the product can be added directly to the cart without customization. If it’s not selected, the product must be customized before being added to cart.

show_customize_design_btn ?? false))>
Show “Customize Design” Button

When the checkbox is selected, the product can be customized before being added to cart.

Drop image here or click to upload
Max size: 1MB | Dimensions: 512x512 px
Drop image here or click to upload
Max size: 1MB | Dimensions: 512x512 px
Uploaded
{{-- Product Colors --}} {{--
--}} {{--
--}} {{-- --}} {{-- @php--}} {{-- $colors = collect($model->colors) ?? collect();--}} {{-- $hasColors = $colors->isNotEmpty();--}} {{-- @endphp--}} {{--
--}} {{--
--}} {{-- @forelse($colors as $color)--}} {{--
--}} {{--
--}} {{-- --}}{{-- Color value --}} {{--
--}} {{-- --}} {{--
--}} {{-- --}}{{-- Color picker --}} {{-- --}} {{-- --}}{{-- Text hex input (submitted) --}} {{-- --}} {{--
--}} {{-- --}} {{-- Pick a color or type hex (e.g. #FFAA00).--}} {{-- --}} {{--
--}} {{-- --}}{{-- Color image --}} {{--
--}} {{-- --}} {{-- @php--}} {{-- $mediaWithColor = $model--}} {{-- ->getMedia('category_extra_images')--}} {{-- ->first(fn ($media) => $media->getCustomProperty('color_hex') ==$color);--}} {{-- @endphp--}} {{-- --}} {{--
--}} {{-- Drop image or click--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{-- --}}{{-- Delete row --}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{-- @empty--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{-- --}} {{-- --}} {{--
--}} {{-- Pick a color or type--}} {{-- hex (e.g. #FFAA00).--}} {{--
--}} {{--
--}} {{-- --}} {{-- --}} {{--
--}} {{-- Drop image or click--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{-- @endforelse--}} {{--
--}} {{--
--}} {{--
--}} {{-- --}} {{--
--}} {{--
--}} {{--
--}} {{--
--}} {{--
--}}

Drag images here or click to upload

Max size: 1MB | Dimensions: 512x512 px
@foreach($dimensions as $dimension)
dimensions->contains($dimension->id)) />
@endforeach
has_mockup == 1) />
has_orientation == 1) />
{{-- Tableau Toggle --}}
is_tableau == 1) />
has_custom_prices == 1)>
has_custom_prices == 0)>
@forelse($model->prices as $price)
@empty
@endforelse
@php $tableauFixedKeys = ['frame_model', 'tableau_size', 'frame_color']; $editableSpecifications = $model->specifications->filter(function ($specification) use ($tableauFixedKeys) { return $specification->fixed_key !== 'cutting' && ($specification->type != 'fixed' || in_array($specification->fixed_key, $tableauFixedKeys, true)); }); $hasSpecs = $editableSpecifications->isNotEmpty(); $cuttingSpec = $model->specifications() ->where('fixed_key', 'cutting') ->first(); $cuttingSpecId = $cuttingSpec?->id; @endphp
Select one or more specs. They will be added automatically below.
{{--
--}} {{--
--}} {{-- --}} {{-- --}} {{-- --}} {{--
--}} {{--
--}} {{--
--}}
@forelse($editableSpecifications as $specification)
fixed_key, $tableauFixedKeys, true)) data-spec-key="{{ $specification->fixed_key }}" @endif>
fixed_key, $tableauFixedKeys, true)) placeholder="Specification Name (EN)"/>
fixed_key, $tableauFixedKeys, true)) placeholder="Specification Name (AR)"/>
@foreach($specification->options as $option)
Max size: 1MB | Dimensions: 200x200 px
{{-- Frame Image per Option --}}
Drop frame image here or click to upload
Max size: 1MB | Dimensions: 200x200 px
@endforeach
@empty
Max size: 1MB | Dimensions: 200x200 px {{-- Frame Image per Option (empty state) --}}
@endforelse
@include("modals.products.add-size")
@endsection @section('vendor-script') @endsection @section('page-script') {{-- --}} {{-- --}} @endsection