@if(session()->has('product_updated')) @endif @include('includes.form_errors') @can('read', App\Location::class)
@lang('Location:') @if($product->location) {{$product->location->name}} @else @lang('None') @endif

@endcan {!! Form::model($product, ['method'=>'patch', 'action'=>['ManageProductsController@update', $product->id], 'files'=>true, 'onsubmit'=>'submit_button.disabled = true; submit_button.value = "' . __('Please Wait...') . '"; return true;']) !!} @if($product->photo) @if($product->photo->name) @php $image_url = \App\Helpers\Helper::check_image_avatar($product->photo->name, 150); @endphp {{$product->name}} @else {{$product->name}} @endif
@endif @if(count($product->photos) > 0)

@foreach($product->photos as $photo)
@if($photo->name) @php $image_url = \App\Helpers\Helper::check_image_avatar($photo->name, 80); @endphp {{$product->name}} @else {{$product->name}} @endif
@endforeach
@endif
{!! Form::label('name', __('Name:')) !!} {!! Form::text('name', null, ['class'=>'form-control', 'placeholder'=>__('Enter name'), 'required'])!!}
{!! Form::label('description', __('Description:')) !!} {!! Form::textarea('description', null, ['class'=>'form-control', 'placeholder'=>__('Enter description')]) !!}
{!! Form::label('model', __('Model Name / Version:')) !!} {!! Form::text('model', null, ['class'=>'form-control', 'placeholder'=>__('Enter model number / version')])!!}
{!! Form::label('regular_price', __('Regular Price:')) !!} {!! Form::number('regular_price', $product->old_price, ['class'=>'form-control', 'step'=>'any', 'placeholder'=>__('Enter regular price')]) !!}
{!! Form::label('price', __('Base Selling Price:')) !!} {!! Form::number('price', null, ['class'=>'form-control', 'step'=>'any', 'placeholder'=>__('Enter selling price'), 'required']) !!}
@if(count($variants)) @foreach($variants as $key => $variant) @php $class = ''; $checked = 0; if (isset($variant['c'])){ if(strtoupper($variant['c']) == '1'): $class = 'colorPickSelector'; $checked = 1; endif; } @endphp
@foreach($variant['v'] as $value) @endforeach
@lang('Name') @lang('Additional Cost')
@endforeach @endif
{!! Form::label('sku', __('SKU:')) !!}
{{$vendor_prefix ? __('Vendor Prefix:'). $vendor_prefix . "-" : ""}} {!! Form::text('sku', $sku, ['class'=>'form-control', 'placeholder'=>__('Enter sku')])!!}
{!! Form::label('hsn', 'HSN:') !!}
{{$vendor_prefix ? __('Vendor Prefix:'). $vendor_prefix . "-" : ""}} {!! Form::text('hsn', $hsn, ['class'=>'form-control', 'placeholder'=>__('Enter hsn')])!!}
{!! Form::label('tax_rate', __('Tax Rate:')) !!} {!! Form::number('tax_rate', null, ['class'=>'form-control', 'step'=>'any', 'min'=>0, 'max'=>100, 'placeholder'=>__('Enter tax rate'), 'required']) !!}
{!! Form::label('brand', __('Brand:')) !!} {!! Form::select('brand', [''=>__('None')] + $brands, $product->brand_id, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!}
@if(count($root_categories) > 0)
@lang('Category:') @if(!$product->category) @lang('None') @else {{ $product->category->name }} (@lang('ID:') {{ $product->category->id }})@endif
@endif @if($product->category)
@endif
@if(count($product->specificationTypes) > 0) @foreach($product->specificationTypes as $product_specification_type) @endforeach @else @endif
@lang('Specification Type') @lang('Value') @lang('Unit')
{!! Form::select('specification_type[]', $specification_types, $product_specification_type->id, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!} {!! Form::text('specification_type_value[]', $product_specification_type->pivot->value, ['class'=>'form-control', 'placeholder'=>__('Example: 14, 3.5, red')])!!} {!! Form::text('specification_type_unit[]', $product_specification_type->pivot->unit, ['class'=>'form-control', 'placeholder'=>__('kg, GHz (Leave blank if no unit)')])!!}
{!! Form::select('specification_type[]', $specification_types, null, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!} {!! Form::text('specification_type_value[]', null, ['class'=>'form-control', 'placeholder'=>__('Example: 14, 3.5')])!!} {!! Form::text('specification_type_unit[]', null, ['class'=>'form-control', 'placeholder'=>__('Example: inch, kg')])!!}

@if(count($custom_fields = unserialize($product->custom_fields)) > 0 && is_array($custom_fields)) @foreach($custom_fields as $key => $field) @endforeach @else @endif
@lang('Name') @lang('Value')
{!! Form::text('custom_field_name[]', $key, ['class'=>'form-control', 'placeholder'=>__('Name')])!!} {!! Form::text('custom_field_value[]', $field, ['class'=>'form-control', 'placeholder'=>__('Value')])!!}
{!! Form::text('custom_field_name[]', null, ['class'=>'form-control', 'placeholder'=>__('Name')])!!} {!! Form::text('custom_field_value[]', null, ['class'=>'form-control', 'placeholder'=>__('Value')])!!}

@if($product->file)
{{$product->file->original_filename}}
@endif
{!! Form::label('file', __('Choose File In Zip'), ['class'=>'btn btn-default btn-file']) !!} {!! Form::file('file',['class'=>'form-control', 'style'=>'display: none;','onchange'=>'$("#upload-file-name").html(files[0].name)']) !!} @lang('No file chosen')
{!! Form::label('in_stock', __('Number in Stock:')) !!} {!! Form::number('in_stock', null, ['class'=>'form-control', 'placeholder'=>__('Enter number in stock')]) !!}
{!! Form::label('qty_per_order', __('Maximum allowed Quantity per Order:')) !!} {!! Form::number('qty_per_order', null, ['class'=>'form-control', 'placeholder'=>__('Enter maximum allowed quantity per order')]) !!}
{!! Form::label('status', __('Status:')) !!} {!! Form::select('status', [0=>__('inactive'), 1=>__('active')], $product->is_active, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']) !!}
{!! Form::label('photo', __('Choose Featured Image'), ['class'=>'btn btn-default btn-file']) !!} {!! Form::file('photo',['class'=>'form-control', 'style'=>'display: none;','onchange'=>'$("#upload-file-info").html(files[0].name)']) !!} @lang('No image chosen')
@include('partials.manage.meta-fields')
{!! Form::submit(__('Update'), ['class'=>'btn btn-primary col-xs-6 col-sm-6 pull-left', 'name'=>'submit_button']) !!}
{!! Form::close() !!}

{!! Form::model($product, ['method'=>'patch', 'action'=>['ManageProductsController@storeMoreImages', $product->id], 'class'=>'dropzone']) !!} {!! Form::close() !!}