@extends('master') @section('breadcrumb') @stop @section('content')

Editar producto: {{ $product->name }}

{!! Form::open(['url' => '/shop/'.$shop->id.'/product/'.$product->id.'/edit', 'files' => true]) !!}
{!! Form::text('name', $product->name) !!}
{!! Form::select('category_id', $shop->getCategoriesPluck(), $product->category_id, ['class' => 'form-select']) !!}
{!! Form::textarea('content', $product->content, ['class' => 'form-control editor', 'data-editor' => 'true', 'id' => 'product_content']) !!}
{!! Form::number('price', $product->price, ['required', 'step' => 'any', 'min' => '1']) !!}
{!! Form::file('image', ['class' => 'product_img_prew', 'id' => 'product_img_prew_field']) !!} Tamaño: 728*364
{!! Form::number('discount', $product->discount, ['min' => '0']) !!}
{!! Form::select('status', shop_product_status(), $product->status, ['class' => 'form-select']) !!}
{!! Form::close() !!}

Imagen Actual

@if($product->file_name) @else @endif

Previsualización

Crear Selecciones / Extras

{!! Form::open(['url' => '/shop/'.$shop->id.'/product/'.$product->id.'/selections/add', 'files' => true]) !!}
{!! Form::text('name', null) !!}
{!! Form::text('title', null) !!}
{!! Form::number('selections', 1, ['min' => '1']) !!}
{!! Form::select('type', ['0' => 'Selección', '1' => 'Extra'], null, ['class' => 'form-select']) !!}
{!! Form::close() !!}
@foreach($product->getSelections as $selection)

{{ $selection->name }}

{!! Form::open(['url' => '/shop/'.$shop->id.'/product/'.$product->id.'/selection/'.$selection->id.'/edit', 'files' => true]) !!}
{!! Form::text('name', $selection->name) !!}
{!! Form::text('title', $selection->title) !!}
{!! Form::number('selections', $selection->selections) !!}
{!! Form::number('orden', $selection->orden) !!}
{!! Form::close() !!}
{!! Form::open(['url' => '/shop/'.$shop->id.'/product/'.$product->id.'/selection/'.$selection->id.'/option/add']) !!}
{!! Form::text('name', null) !!}
@if($selection->object_type == "1")
{!! Form::number('price', '0.00', ['min' => '1.00', 'required']) !!}
@endif {!! Form::close() !!}
    @foreach($selection->getOptions as $option)
  • {{ $option->name }} @if($option->price > 0) {{ number($option->price) }} @endif
  • @endforeach
@endforeach
@endsection