@forelse ($products as $product)
    @php
        $row_index = $loop->index + $index;
    @endphp
    <tr id="tr_row_index_{{$row_index}}">
        <td>
            {{$product->Title}}
            
            <input type="hidden" name="products[{{$loop->index + $index}}][product_id]" value="{{$product->id}}">            
            <input type="hidden" name="products[{{$loop->index + $index}}][product_title]" value="{{$product->Title}}">            
        </td>
        <td>
            <select name="products[{{$loop->index + $index}}][category_code]" class="form-control select2">
                <option value="">0-0 - Unknown</option>
                @if(!empty($category_code))
                    @foreach($category_code as $cc)
                        <option value="{{ $cc->category_code }}|{{ $cc->category_name }}" @if($cc->category_code == $product->category_code_selected && $cc->category_name == $product->category_name_selected) selected @endif>{{ $cc->category_code. ' - ' .$cc->category_name }}</option>
                    @endforeach
                @endif
            </select>
        </td>
        <td>
            <!-- {{$product->Price}} -->
            <input type="number" class="form-control" min=1
            name="products[{{$loop->index + $index}}][price]" value="@if(isset($product->label_price)){{$product->label_price}}@else{{$product->AmazonSellerInventoryPrice}}@endif">
        </td>
        <td>
            {{-- <input type="number" class="form-control" min=1
            name="products[{{$loop->index + $index}}][quantity]" value="@if(isset($product->CurrentQty)){{$product->CurrentQty}}@else{{1}}@endif"> --}}

            <input type="number" class="form-control" min=1
            name="products[{{$loop->index + $index}}][quantity]" value="1">
        </td>
        <td>
            {{ $product->history_print ?? '' }}
        </td>
        {{-- @if(request()->session()->get('business.enable_lot_number') == 1)
            <td>
                <input type="text" class="form-control"
                name="products[{{$loop->index + $index}}][lot_number]" value="">
            </td>
        @endif
        @if(request()->session()->get('business.enable_product_expiry') == 1)
            <td>
                <input type="text" class="form-control label-date-picker"
                name="products[{{$loop->index + $index}}][exp_date]" value="">
            </td>
        @endif
        <!-- <td>
            <input type="text" class="form-control label-date-picker"
            name="products[{{$loop->index + $index}}][packing_date]" value="">
        </td> -->
        <td>
            {!! Form::select('products[' . $row_index . '][price_group_id]', $price_groups, null, ['class' => 'form-control', 'placeholder' => __('lang_v1.none')]); !!}
        </td> --}}
        <td>
            <i class="fa fa-times text-danger label_remove_row cursor-pointer" aria-hidden="true" style="margin-top: 5px;" onclick="label_remove_row('{{$row_index}}')"></i>
        </td>
    </tr>
@empty

@endforelse