@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. Product Details Quantity & Price Product Specs Product Name (EN) Product Name (AR) Product Description (EN) {{ $model->getTranslation('description','en') }} Product Description (AR) {{ $model->getTranslation('description','ar') }} Product Image (main) Drop image here or click to upload Max size: 1MB | Dimensions: 512x512 px Product Model Image (main)* Drop image here or click to upload Max size: 1MB | Dimensions: 512x512 px {{-- Product Colors --}} {{-- --}} {{-- --}} {{-- Product Colors--}} {{-- @php--}} {{-- $colors = collect($model->colors) ?? collect();--}} {{-- $hasColors = $colors->isNotEmpty();--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- @forelse($colors as $color)--}} {{-- --}} {{-- --}} {{-- --}}{{-- Color value --}} {{-- --}} {{-- Color Value--}} {{-- *--}} {{-- --}} {{-- --}}{{-- Color picker --}} {{-- --}} {{-- --}}{{-- Text hex input (submitted) --}} {{-- --}} {{-- --}} {{-- --}} {{-- Pick a color or type hex (e.g. #FFAA00).--}} {{-- --}} {{-- --}} {{-- --}}{{-- Color image --}} {{-- --}} {{-- Color Image *--}} {{-- --}} {{-- @php--}} {{-- $mediaWithColor = $model--}} {{-- ->getMedia('category_extra_images')--}} {{-- ->first(fn ($media) => $media->getCustomProperty('color_hex') ==$color);--}} {{-- @endphp--}} {{-- --}} {{-- --}} {{-- Drop image or click--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}{{-- Delete row --}} {{-- --}} {{-- --}} {{-- --}} {{-- Delete--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @empty--}} {{-- --}} {{-- --}} {{-- --}} {{-- Color Value--}} {{-- *--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- Pick a color or type--}} {{-- hex (e.g. #FFAA00).--}} {{-- --}} {{-- --}} {{-- Color Image *--}} {{-- --}} {{-- --}} {{-- --}} {{-- Drop image or click--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- Delete--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- @endforelse--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- Add New Color--}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}} Product Images Drag images here or click to upload Max size: 1MB | Dimensions: 512x512 px Product Ordering* Tags @foreach($associatedData['tags'] as $tag) id, $model->tags->pluck('id')->toArray())) selected @endif >{{ $tag->name }} @endforeach Product Size @foreach($dimensions as $dimension) dimensions->contains($dimension->id)) /> {{ $dimension['name'] }} @endforeach Add Custom Size Is this product has Mockup? has_mockup == 1) /> Is this product has Orientation? has_orientation == 1) /> {{-- Tableau Toggle --}} Is this product a Tableau? is_tableau == 1) /> Next Quantity & Price Options Quantity Type has_custom_prices == 1)> Add Quantity Manually Custom Prices has_custom_prices == 0)> Default Quantity Default Price @forelse($model->prices as $price) Quantity Price (EGP) Delete @empty Quantity Price (EGP) Delete @endforelse Add New Quantity Original Price (EGP) (Per Item) Previous Next @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 Product Specs Add Cutting Specs Remove Cutting Specs Choose Cutting Specs @foreach(\App\Enums\Product\CuttingEnum::cases() as $cutting) {{ $cutting->label(app()->getLocale()) }} @endforeach Select one or more specs. They will be added automatically below. {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- Product available for free shipping--}} {{-- --}} {{-- --}} {{-- --}} @forelse($editableSpecifications as $specification) fixed_key, $tableauFixedKeys, true)) data-spec-key="{{ $specification->fixed_key }}" @endif> Name (EN) fixed_key, $tableauFixedKeys, true)) placeholder="Specification Name (EN)"/> Name (AR) fixed_key, $tableauFixedKeys, true)) placeholder="Specification Name (AR)"/> @foreach($specification->options as $option) Value (EN) Value (AR) Price (EGP) (Optional) Padding Value (Optional) Option Image Max size: 1MB | Dimensions: 200x200 px Delete Value {{-- Frame Image per Option --}} Option Frame Image Drop frame image here or click to upload Max size: 1MB | Dimensions: 200x200 px @endforeach Add New Value Delete Spec @empty Name (EN) Name (AR) Value (EN) Value (AR) Price (EGP) (Optional) Padding Value (Optional) Option Image Max size: 1MB | Dimensions: 200x200 px {{-- Frame Image per Option (empty state) --}} Option Frame Image Drop frame image here or click to upload Max size: 1MB | Dimensions: 200x200 px Delete Value Add New Value Delete Spec @endforelse Add Custom Spec Variants Back Edit Product @include("modals.products.add-size") @endsection @section('vendor-script') @endsection @section('page-script') {{-- --}} {{-- --}} @endsection
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.
When the checkbox is selected, the product can be customized before being added to cart.
Drag images here or click to upload