@php $title_classes = isset($product) ? 'form-control' : 'form-control makeSlug'; @endphp

{{ isset($product) ? trans('app.update_product') : trans('app.add_product') }}

{{--
@if (!isset($product)) {{ trans('app.bulk_import') }} @endif
--}}
{!! Form::label('name', trans('app.form.name') . '*', ['class' => 'with-help']) !!} {!! Form::text('name', null, ['class' => $title_classes, 'placeholder' => trans('app.placeholder.title'), 'required']) !!}
{!! Form::label('mpn', trans('app.form.mpn'), ['class' => 'with-help']) !!} {!! Form::text('mpn', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.mpn')]) !!}
{!! Form::label('gtin', trans('app.form.gtin'), ['class' => 'with-help']) !!} {!! Form::text('gtin', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.gtin')]) !!}
{!! Form::label('gtin_type', trans('app.form.gtin_type'), ['class' => 'with-help']) !!} {!! Form::select('gtin_type', $gtin_types, null, ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.gtin_type')]) !!}
{!! Form::label('sku', trans('app.form.sku') . '*', ['class' => 'with-help']) !!} {!! Form::text('sku', isset($inventory) ? $inventory->sku : null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.sku'), 'required']) !!}
@if (config('system_settings.show_item_conditions'))
{!! Form::label('condition', trans('app.form.condition') . '*', ['class' => 'with-help']) !!} {!! Form::select('condition', ['New' => trans('app.new'), 'Used' => trans('app.used'), 'Refurbished' => trans('app.refurbished')], isset($inventory) ? $inventory->condition : null, ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.select'), 'required']) !!}
@endif
{!! Form::label('active', trans('app.form.status') . '*', ['class' => 'with-help']) !!} {!! Form::select('active', ['1' => trans('app.active'), '0' => trans('app.inactive')], isset($inventory) ? $inventory->active : 1, ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.select'), 'required']) !!}
@if (config('system_settings.show_item_conditions'))
{!! Form::label('condition_note', trans('app.form.condition_note'), ['class' => 'with-help']) !!} {!! Form::text('condition_note', isset($inventory) ? $inventory->condition_note : null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.placeholder.condition_note')]) !!}
@endif
{{ trans('app.form.key_features') }}
@if (isset($inventory) && $inventory->key_features) @foreach (unserialize($inventory->key_features) as $key_feature)
{!! Form::text('key_features[]', $key_feature, ['class' => 'form-control input-sm', 'placeholder' => trans('app.placeholder.key_feature')]) !!}
@endforeach @else
{!! Form::text('key_features[]', null, ['id' => 'field_1', 'class' => 'form-control input-sm', 'placeholder' => trans('app.placeholder.key_feature')]) !!}
@endif
{!! Form::label('description', trans('app.form.description') . '*', ['class' => 'with-help']) !!} {!! Form::textarea('description', isset($inventory) ? $inventory->description : null, ['class' => 'form-control summernote', 'rows' => '4', 'placeholder' => trans('app.placeholder.description'), 'required']) !!}
{!! $errors->first('description', ':message') !!}
{{ trans('app.form.images') }}
{{ trans('help.multi_img_upload_instruction', ['size' => getAllowedMaxImgSize(), 'number' => getMaxNumberOfImgsForInventory(), 'dimension' => '800 x 800']) }}
{{ trans('app.inventory_rules') }}
{!! Form::label('stock_quantity', trans('app.form.stock_quantity') . '*', ['class' => 'with-help']) !!} {!! Form::number('stock_quantity', isset($inventory) ? $inventory->stock_quantity : 1, ['min' => 0, 'class' => 'form-control', 'placeholder' => trans('app.placeholder.stock_quantity'), 'required']) !!}
{!! Form::label('min_order_quantity', trans('app.form.min_order_quantity'), ['class' => 'with-help']) !!} {!! Form::number('min_order_quantity', isset($inventory) ? $inventory->min_order_quantity : 1, ['min' => 1, 'class' => 'form-control', 'placeholder' => trans('app.placeholder.min_order_quantity')]) !!}
{!! Form::label('sale_price', trans('app.form.sale_price') . '*', ['class' => 'with-help']) !!}
@if (get_currency_prefix()) {{ get_currency_prefix() }} @endif {!! Form::number('sale_price', isset($inventory) ? $inventory->sale_price : null, ['class' => 'form-control', 'step' => 'any', 'placeholder' => trans('app.placeholder.sale_price'), 'required']) !!} {{-- max_price ? ' max="'. $product->max_price .'"' : '' }} step="any" placeholder="{{ trans('app.placeholder.sale_price') }}" class="form-control" required="required"> --}} @if (get_currency_suffix()) {{ get_currency_suffix() }} @endif
{!! Form::label('offer_price', trans('app.form.offer_price'), ['class' => 'with-help']) !!}
@if (get_currency_prefix()) {{ get_currency_prefix() }} @endif {!! Form::number('offer_price', isset($inventory) ? $inventory->offer_price : null, ['class' => 'form-control', 'step' => 'any', 'placeholder' => trans('app.placeholder.offer_price')]) !!} @if (get_currency_suffix()) {{ get_currency_suffix() }} @endif
{!! Form::label('offer_start', trans('app.form.offer_start'), ['class' => 'with-help']) !!}
{!! Form::text('offer_start', isset($inventory) ? $inventory->offer_start : null, ['class' => 'form-control datetimepicker', 'placeholder' => trans('app.placeholder.offer_start')]) !!}
{!! Form::label('offer_end', trans('app.form.offer_end'), ['class' => 'with-help']) !!}
{!! Form::text('offer_end', isset($inventory) ? $inventory->offer_end : null, ['class' => 'form-control datetimepicker', 'placeholder' => trans('app.placeholder.offer_end')]) !!}
{!! Form::label('linked_items[]', trans('app.form.linked_items'), ['class' => 'with-help']) !!} {!! Form::select('linked_items[]', $inventories, isset($inventory) ? unserialize($inventory->linked_items) : null, ['class' => 'form-control select2-normal', 'multiple' => 'multiple']) !!}
{{ trans('app.attributes') }} {{-- {{ trans('app.add_variants') }} --}} @if (isset($product) && $product->inventories->count())
{{ trans('app.variants') }} {{-- --}} @include('admin.product.inventory._variants')
@else

{!! trans('help.select_category') !!}

{!! trans('help.choose_attributes') !!}

@endif

* {{ trans('app.form.required_fields') }}

{!! Form::submit(isset($product) ? trans('app.form.update') : trans('app.form.save'), ['class' => 'btn btn-flat btn-lg btn-primary']) !!}

{{ trans('app.organization') }}

{!! Form::label('available_from', trans('app.form.available_from'), ['class' => 'with-help']) !!}
{!! Form::text('available_from', isset($inventory) ? $inventory->available_from : null, ['class' => 'datetimepicker form-control', 'placeholder' => trans('app.placeholder.available_from')]) !!}
@if (is_incevio_package_loaded('pharmacy')) @include('pharmacy::inventory_form') @endif
{!! Form::label('category_list[]', trans('app.form.categories') . '*') !!} {!! Form::select('category_list[]', $categories, null, ['class' => 'form-control select2-normal', 'multiple' => 'multiple', 'required']) !!}
{{ trans('app.catalog_rules') }}
{{ Form::hidden('requires_shipping', 0) }} {!! Form::checkbox('requires_shipping', null, !isset($product) ? 1 : null, ['id' => 'requires_shipping', 'class' => 'icheckbox_line requires_shipping']) !!} {!! Form::label('requires_shipping', trans('app.form.requires_shipping')) !!}
{{ Form::hidden('downloadable', 0) }} {!! Form::checkbox('downloadable', null, null, ['class' => 'icheckbox_line downloadable']) !!} {!! Form::label('downloadable', trans('app.form.downloadable')) !!}
    @if (isset($inventory)) @foreach ($inventory->attachments as $attachment)
  • {{ $attachment->name }} {{ get_formated_file_size($attachment->size) }}
  • @endforeach @endif
{!! Form::label('digital_file', trans('app.form.digital_file'), ['class' => 'with-help']) !!}
{!! Form::label('download_limit', trans('app.form.download_limit'), ['class' => 'with-help']) !!} {!! Form::number('download_limit', isset($inventory) ? $inventory->download_limit : null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.download_limit')]) !!}
{{ trans('app.shipping') }}
{{ Form::hidden('free_shipping', 0) }} {!! Form::checkbox('free_shipping', null, null, ['id' => 'free_shipping', 'class' => 'icheckbox_line']) !!} {!! Form::label('free_shipping', trans('app.form.free_shipping')) !!}
{!! Form::label('warehouse_id', trans('app.form.warehouse'), ['class' => 'with-help']) !!} {!! Form::select('warehouse_id', $warehouses, isset($warehouse) ? $warehouse->id : config('shop_settings.default_warehouse_id'), ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.select')]) !!}
{!! Form::label('length', trans('app.form.length'), ['class' => 'with-help']) !!} {!! Form::text('length', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.shipping_length')]) !!}
{!! Form::label('width', trans('app.form.width'), ['class' => 'with-help']) !!} {!! Form::text('width', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.shipping_width')]) !!}
{!! Form::label('height', trans('app.form.height'), ['class' => 'with-help']) !!} {!! Form::text('height', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.shipping_height')]) !!}
{!! Form::label('distance_unit', trans('app.form.distance_unit'), ['class' => 'with-help']) !!} {!! Form::select('distance_unit', ['cm' => 'Centimeter', 'm' => 'Meter'], 'cm', ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.distance_unit')]) !!}
{!! Form::label('shipping_weight', trans('app.form.shipping_weight'), ['class' => 'with-help']) !!}
{!! Form::number('shipping_weight', isset($inventory) ? $inventory->shipping_weight : null, ['class' => 'form-control', 'step' => 'any', 'min' => 0, 'placeholder' => trans('app.placeholder.shipping_weight')]) !!} {{ config('system_settings.weight_unit') ?? 'gm' }}
@if (is_incevio_package_loaded('packaging'))
{!! Form::label('packaging_list[]', trans('packaging::lang.packagings'), ['class' => 'with-help']) !!} {!! Form::select('packaging_list[]', $packagings, isset($inventory) ? null : config('shop_settings.default_packaging_ids'), ['class' => 'form-control select2-normal', 'multiple' => 'multiple']) !!}
@endif
{{--
--}} {{-- @if (isset($attributes) && $attributes->count()) --}} {{-- @include('admin.product._attribute_dropdown', ['attributes' => $attributes]) --}} {{-- @endif --}} {{--
--}}
{{ trans('app.featured_image') }} @if (isset($product) && $product->featureImage) {{ trans('app.featured_image') }} @endif
{{ trans('app.form.upload') }}
{{ trans('app.branding') }}
{!! Form::label('origin_country', trans('app.form.origin'), ['class' => 'with-help']) !!} {!! Form::select('origin_country', $countries, null, ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.origin')]) !!}
{!! Form::label('manufacturer_id', trans('app.form.manufacturer'), ['class' => 'with-help']) !!} {!! Form::select('manufacturer_id', $manufacturers, null, ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.manufacturer')]) !!}
{!! Form::label('brand', trans('app.form.brand'), ['class' => 'with-help']) !!} {!! Form::text('brand', isset($inventory) ? $inventory->brand : null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.brand')]) !!}
{!! Form::label('model_number', trans('app.form.model_number'), ['class' => 'with-help']) !!} {!! Form::text('model_number', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.model_number')]) !!}
{{ trans('app.reporting') }}
{!! Form::label('purchase_price', trans('app.form.purchase_price'), ['class' => 'with-help']) !!}
@if (get_currency_prefix()) {{ get_currency_prefix() }} @endif {!! Form::number('purchase_price', isset($inventory) ? $inventory->purchase_price : null, ['class' => 'form-control', 'step' => 'any', 'placeholder' => trans('app.placeholder.purchase_price')]) !!} @if (get_currency_suffix()) {{ get_currency_suffix() }} @endif
{!! Form::label('supplier_id', trans('app.form.supplier'), ['class' => 'with-help']) !!} {!! Form::select('supplier_id', $suppliers, isset($inventory) ? null : config('shop_settings.default_supplier_id'), ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.select')]) !!}
{{ trans('app.seo') }}
{!! Form::label('slug', trans('app.form.slug') . '*', ['class' => 'with-help']) !!} {!! Form::text('slug', isset($inventory) ? $inventory->slug : null, ['class' => 'form-control slug', 'placeholder' => trans('app.placeholder.slug'), 'required']) !!}
{!! Form::label('tag_list[]', trans('app.form.tags'), ['class' => 'with-help']) !!} {!! Form::select('tag_list[]', $tags, null, ['class' => 'form-control select2-tag', 'multiple' => 'multiple']) !!}
{!! Form::label('meta_title', trans('app.form.meta_title'), ['class' => 'with-help']) !!} {!! Form::text('meta_title', isset($inventory) ? $inventory->meta_title : null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.meta_title')]) !!}
{!! Form::label('meta_description', trans('app.form.meta_description'), ['class' => 'with-help']) !!} {!! Form::text('meta_description', isset($inventory) ? $inventory->meta_description : null, ['class' => 'form-control', 'maxlength' => config('seo.meta.description_character_limit', '160'), 'placeholder' => trans('app.placeholder.meta_description')]) !!}
{{ trans('help.max_chat_allowed', ['size' => config('seo.meta.description_character_limit', '160')]) }}