@extends('admin.layouts.master') @section('content') @can('view', $product) @include('admin.partials._product_widget') @endcan {!! Form::open(['route' => 'admin.stock.inventory.storeWithVariant', 'files' => true, 'id' => 'form', 'data-toggle' => 'validator']) !!} {{-- @if (isset($product)) {{ Form::hidden('product_id', $product->id) }} @elseif($inventory) {{ Form::hidden('product_id', $inventory->product_id) }} @endif --}} @if (isset($inventory)) @php $product = $inventory->product; @endphp @endif

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

{{ Form::hidden('product', $product) }}
{!! Form::label('title', trans('app.form.title') . '*') !!} {!! Form::text('title', null, ['class' => 'form-control makeSlug', 'placeholder' => trans('app.placeholder.title'), 'required']) !!}
{!! Form::label('warehouse_id', trans('app.form.warehouse'), ['class' => 'with-help']) !!} {!! Form::select('warehouse_id', $warehouses, null, ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.select')]) !!}
@isset($suppliers)
{!! Form::label('supplier_id', trans('app.form.supplier'), ['class' => 'with-help']) !!} {!! Form::select('supplier_id', $suppliers, null, ['class' => 'form-control select2', 'placeholder' => trans('app.placeholder.select')]) !!}
@endisset
{!! Form::label('available_from', trans('app.form.available_from'), ['class' => 'with-help']) !!}
{!! Form::text('available_from', null, ['class' => 'form-control datetimepicker', 'placeholder' => trans('app.placeholder.available_from')]) !!}
{!! Form::label('active', trans('app.form.status') . '*', ['class' => 'with-help']) !!} {!! Form::select('active', ['1' => trans('app.active'), '0' => trans('app.inactive')], 1, ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.select'), 'required']) !!}
@if ($product->requires_shipping)
{!! Form::label('min_order_quantity', trans('app.form.min_order_quantity'), ['class' => 'with-help']) !!} {!! Form::number('min_order_quantity', isset($inventory) ? null : 1, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.min_order_quantity')]) !!}
{!! Form::label('shipping_weight', trans('app.form.shipping_weight'), ['class' => 'with-help']) !!}
{!! Form::number('shipping_weight', null, ['class' => 'form-control', 'step' => 'any', 'placeholder' => trans('app.placeholder.shipping_weight')]) !!} {{ config('system_settings.weight_unit') ?? 'gm' }}
{{ 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')) !!}
@if (is_incevio_package_loaded('packaging'))
{!! Form::label('packaging_list[]', trans('packaging::lang.packaging'), ['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
@endif @if (is_incevio_package_loaded('pharmacy')) @include('pharmacy::inventory_form') @endif @if (config('system_settings.show_item_conditions'))
{!! Form::label('condition_note', trans('app.form.condition_note'), ['class' => 'with-help']) !!} {!! Form::text('condition_note', null, ['class' => 'form-control input-sm', 'placeholder' => trans('app.placeholder.condition_note')]) !!}
@endif
{!! Form::label('description', trans('app.form.description'), ['class' => 'with-help']) !!} {!! Form::textarea('description', null, ['class' => 'form-control summernote', 'placeholder' => trans('app.placeholder.description')]) !!}

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

@if (config('system_settings.show_item_conditions')) @endif @php $i = 0; @endphp @foreach ($combinations as $combination) @if (config('system_settings.show_item_conditions')) @endif @endforeach
{{ trans('app.sl_number') }} {{ trans('app.form.variants') }} {{ trans('app.form.image') }} {{ trans('app.form.sku') }} {{ trans('app.form.condition') }} {{ trans('app.form.stock_quantity') }} {{ trans('app.form.purchase_price') }} {{ trans('app.form.sale_price') }} {{ trans('app.form.offer_price') }}
{{ $i + 1 }}
@foreach ($combination as $attrId => $attrValue) {{ Form::hidden('variants[' . $i . '][' . $attrId . ']', key($attrValue)) }} {{ $attributes[$attrId] . ' : ' . current($attrValue) }} {{ $attrValue !== end($combination) ? '; ' : '' }} @endforeach
{!! Form::text('sku[' . $i . ']', null, ['class' => 'form-control sku', 'placeholder' => trans('app.placeholder.sku'), 'required']) !!}
{!! Form::select('condition[' . $i . ']', ['New' => trans('app.new'), 'Used' => trans('app.used'), 'Refurbished' => trans('app.refurbished')], null, ['class' => 'form-control condition', 'required']) !!}
{!! Form::number('stock_quantity[' . $i . ']', null, ['class' => 'form-control quantity', 'placeholder' => trans('app.placeholder.stock_quantity'), 'required']) !!}
{!! Form::number('purchase_price[' . $i . ']', null, ['class' => 'form-control purchasePrice', 'step' => 'any', 'placeholder' => trans('app.placeholder.purchase_price')]) !!}
{!! Form::number('sale_price[' . $i . ']', null, ['class' => 'form-control salePrice', 'step' => 'any', 'placeholder' => trans('app.placeholder.sale_price'), 'required']) !!}
{!! Form::number('offer_price[' . $i . ']', null, ['class' => 'form-control offerPrice', 'step' => 'any', 'placeholder' => trans('app.placeholder.offer_price')]) !!}
@include('admin.inventory._key_features') @include('admin.inventory._cross_selling_fields')

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

{!! Form::label('slug', trans('app.form.slug') . '*', ['class' => 'with-help']) !!} {!! Form::text('slug', null, ['class' => 'form-control slug', 'placeholder' => 'SEO Friendly URL', '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', 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', null, ['class' => 'form-control', 'placeholder' => trans('app.placeholder.meta_description')]) !!}

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

{!! Form::submit(trans('app.form.save'), ['class' => 'btn btn-flat btn-lg btn-new pull-right']) !!}
{!! Form::close() !!} @endsection @section('page-script') @include('plugins.dynamic-inputs') @endsection