@extends('layouts.app') @section('title', __('product.edit_product')) @section('content')

@lang('product.edit_product')

{!! Form::open(['url' => action('ProductController@update' , [$product->id] ), 'method' => 'PUT', 'id' => 'product_add_form', 'class' => 'product_form', 'files' => true ]) !!}
{!! Form::label('status', 'Product Status' . ':*') !!}
{!! Form::hidden('status', 0, null); !!} {!! Form::checkbox('status', 1, $product->status , [ 'class' => 'input-icheck']); !!} {{ __( 'Active Product' ) }}
{!! Form::label('location_id', __('purchase.business_location').':*') !!} {!! Form::select('location_id', $business_locations, $product->location_id !== 0 ? $product->location_id : '', ['class' => 'form-control select2', 'id' => 'purchase_location_id', 'placeholder' => 'All']); !!}
{!! Form::label('name', __('product.product_name') . ':*') !!} {!! Form::text('name', $product->name, ['class' => 'form-control', 'required', 'placeholder' => __('product.product_name')]); !!}
@if (in_array('brand', $industry_enabled_modules))
{!! Form::label('brand_id', __('product.brand') . ':') !!} {!! Form::select('brand_id', $brands, $product->brand_id, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
@endif
{!! Form::label('unit_id', __('product.unit') . ':*') !!} {!! Form::select('unit_id', $units, $product->unit_id, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2', 'required']); !!}
@if (in_array('category', $industry_enabled_modules))
{!! Form::label('category_id', __('product.category') . ':') !!} {!! Form::select('category_id', $categories, $product->category_id, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
@endif @if (in_array('sub_category', $industry_enabled_modules))
{!! Form::label('sub_category_id', __('product.sub_category') . ':') !!} {!! Form::select('sub_category_id', $sub_categories, $product->sub_category_id, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
@endif
{!! Form::label('sku', __('product.sku') . ':*') !!} @show_tooltip(__('tooltip.sku')) {!! Form::text('sku', $product->sku, ['class' => 'form-control', 'placeholder' => __('product.sku'), 'required', 'readonly']); !!}
{!! Form::label('barcode_type', __('product.barcode_type') . ':*') !!} {!! Form::select('barcode_type', $barcode_types, $product->barcode_type, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2', 'required']); !!}

@show_tooltip(__('tooltip.enable_stock'))

@lang('product.enable_stock_help')

enable_stock) style="display:none" @endif>
{!! Form::label('alert_quantity', __('product.alert_quantity') . ':*') !!} @show_tooltip(__('tooltip.alert_quantity')) {!! Form::number('alert_quantity', $product->alert_quantity, ['class' => 'form-control', 'required', 'placeholder' => __('product.alert_quantity') , 'min' => '0']); !!}
{!! Form::label('image', __('lang_v1.product_image') . ':') !!} {!! Form::file('image', ['id' => 'upload_image', 'accept' => 'image/*']); !!}

@lang('purchase.max_file_size', ['size' => (config('constants.document_size_limit') / 1000000)]). @lang('lang_v1.aspect_ratio_should_be_1_1') @if(!empty($product->image))
@lang('lang_v1.previous_image_will_be_replaced') @endif

@if (in_array('cusine', $industry_enabled_modules)) @if (in_array('kitchen', $enabled_modules))
{!! Form::label('cusine', 'Cusine' . ':*') !!} {!! Form::text('cusine', $product->cusine, ['class' => 'form-control', 'placeholder' => 'Cusine']); !!}
@endif @endif @if (in_array('warranty ', $industry_enabled_modules))
{!! Form::label('warranty ', 'Warranty (in Months)' . ':') !!} {!! Form::text('warranty ', null, ['class' => 'form-control', 'placeholder' => 'Warranty in Months']); !!}
@endif
{!! Form::label('is_promotion', 'Promotion Product' . ':*') !!}
{!! Form::hidden('is_promotion', 0, null); !!} {!! Form::checkbox('is_promotion', 1, $product->is_promotion , [ 'class' => 'input-icheck']); !!} {{ __( 'Yes' ) }}

@lang('product.promotion_help')

{!! Form::label('type', __('product.product_type') . ':*') !!} @show_tooltip(__('tooltip.product_type')) {!! Form::select('type', ['single' => 'Single', 'variable' => 'Variable'], $product->type, ['class' => 'form-control select2', 'required','disabled', 'data-action' => 'edit', 'data-product_id' => $product->id ]); !!}
{!! Form::label('distribution_price', 'Distribution Price:*') !!} {!! Form::text('distribution_price', @num_format($product->distribution_price), ['class' => 'form-control input-sm input_number', 'placeholder' => 'Distribution', 'required']); !!}
  
{!! Form::close() !!}
@endsection @section('javascript') @endsection