@php $vcount = (!empty($selectedVariant->variantAttributes))?$selectedVariant->variantAttributes->count():1; $varirantID = (!empty($selectedVariant->variantAttributes))?Request::get('vid'):0; @endphp
@if (!empty($product->productVariant)) @foreach ($product->productVariant as $k=> $val)
@php $class = ""; if($varirantID == $val->id){ $class = "btn btn-default"; }else{ $class = "btn btn-success"; } @endphp Variant {{$k+1}}
@endforeach @endif
@if (empty($selectedVariant)) @include('admin.product.varient_form') @else Add {{ Form::hidden('var_count', 1, array('id' => 'var_count')) }}

{{__('Variant No.')}}

{{ Form::text('stock[]',$selectedVariant->stock, array('id'=>'','class' => "form-control ".APFrmErrHelp::hasError($errors, 'stock')." ",'placeholder' => 'Enter stock','required')) }} {!! APFrmErrHelp::showErrors($errors, 'stock') !!}
{{ Form::text('barcode[]', $selectedVariant->barcode, array('id'=>'','class' => "form-control ".APFrmErrHelp::hasError($errors, 'barcode')." ",'placeholder' => 'Enter barcode','required')) }} {!! APFrmErrHelp::showErrors($errors, 'barcode') !!}
{{ Form::text('sku[]', $selectedVariant->sku, array('id'=>'','class' => "form-control ".APFrmErrHelp::hasError($errors, 'sku')." ",'placeholder' => 'Enter sku' ,'required' )) }}
{{ Form::text('variant_id[]',$selectedVariant->variant_id, array('id'=>'','class' => "form-control ".APFrmErrHelp::hasError($errors, 'variant_id')." ",'placeholder' => 'Enter variant id')) }}
{{--
{!! Form::select('currency[]',['' => __('Select Currency'),'BHD' => __('BHD'),'SAR' => __('SAR'),'KWD' => __('KWD'),'OMR' => __('OMR'),'AED' => __('AED')], $selectedVariant->currency, array('class'=>'form-control select2', 'id'=>'','required')) !!} {!! APFrmErrHelp::showErrors($errors, 'currency') !!}
--}}
{{ Form::text('price[]',$selectedVariant->price, array('id'=>'','class' => "form-control ".APFrmErrHelp::hasError($errors, 'price')." ",'placeholder' => 'Enter price','required')) }}
{{ Form::text('special_price[]',$selectedVariant->special_price, array('id'=>'','class' => "form-control ".APFrmErrHelp::hasError($errors, 'special_price')." ",'placeholder' => 'Enter special price','required')) }}
{{-- attribute Section --}}
{{ Form::hidden('attr_count', $vcount, array('id' => 'attr_count1')) }}
@foreach ($selectedVariant->variantAttributes as $ak => $attrVal)
{!! Form::select('attribute_id[0][]',['' => __('Select Attribute')]+$attributes, $attrVal->attribute_id, array('class'=>'form-control select2 attribute', 'id'=>'','required')) !!} {!! APFrmErrHelp::showErrors($errors, 'attribute_id') !!}
@php $attribute_id = $attrVal->attribute_id; $attribute_values = DB::table('attribute_values')->where('attribute_id', $attribute_id)->pluck('title', 'id')->toArray(); @endphp
{!! Form::select('attribute_value[0][]',['' => __('Select values')]+$attribute_values, $attrVal->attribute_val_id, array('class'=>'form-control select2 attribute_value', 'id'=>'','required')) !!} {!! APFrmErrHelp::showErrors($errors, 'attribute_value') !!}
@if($ak > 0) @endif
@endforeach
@endif