@if (count($combinations[0]) > 0)
@foreach ($combinations as $key => $combination) @php $sku = ''; foreach (explode(' ', $product_name) as $key => $value) { $sku .= substr($value, 0, 1); } $str = ''; $human_str = ''; foreach ($combination as $key => $item) { if ($key > 0) { $human_str .= '-' . str_replace( ' ', '', \App\AttributOption::where('id', $item) ->first() ->getTranslation('title'), ); $str .= '-' . str_replace(' ', '', $item); $sku .= '-' . str_replace(' ', '', $item); } else { if ($colors_active == 1) { $color_name = \App\Color::where('id', $item)->first()->id; $str .= $color_name; $human_str .= \App\Color::where('id', $item) ->first() ->getTranslation('title'); $sku .= $color_name; } else { $str .= str_replace(' ', '', $item); $human_str .= str_replace( ' ', '', \App\AttributOption::where('id', $item) ->first() ->getTranslation('title'), ); $sku .= str_replace(' ', '', $item); } } } @endphp @if (strlen($str) > 0) @endif @endforeach
{{ translate('Variant') }} {{ translate('SKU') }} {{ translate('Sale Price') }} {{ translate('Cost Price') }} {{ translate('Market Price') }} {{ translate('Quantity') }} {{ translate('Weight') }}
{!! Form::text('sku_' . $str, $sku, ['required' => 'required', 'class' => 'form-control']) !!} {!! Form::number('price_' . $str, $unit_price, ['min' => '0', 'step' => '0.01', 'required' => 'required', 'class' => 'form-control']) !!} {!! Form::number('cost_price_' . $str, $cost_price, ['min' => '0', 'step' => '0.01', 'required' => 'required', 'class' => 'form-control']) !!} {!! Form::number('market_price_' . $str, $market_price, ['min' => '0', 'step' => '0.01', 'required' => 'required', 'class' => 'form-control']) !!}
{!! Form::number('qty_' . $str, 10, ['id' => 'qty_' . $str, 'min' => '0', 'step' => '1', 'required' => 'required', 'class' => 'form-control']) !!}
{!! Form::checkbox('current_stock_unlimited_' . $str, null, 0, ['class' => 'current_stock_unlimited', 'mid' => $str, 'id' => 'Checkboxs_' . $str]) !!}
{!! Form::number('weight_' . $str, $weight, ['min' => '0', 'step' => '1', 'required' => 'required', 'class' => 'form-control']) !!}
{!! Form::select('measruing_unit_' . $str, ['kg' => 'KG', 'g' => 'G', 'lb' => 'LB'], $measruing_unit, ['class' => 'form-control ']) !!}
@endif