@if($homeparty_guest && $homeparty_guest->homeparty_user_order_items->count() || $homeparty_guest->is_host)
    <div class="table-responsive">
    <table class="table table-striped">
       <thead>
       <tr>
           <th>{{__('Bild')}}</th>
           <th>{{__('Produkt')}}</th>
           <th>{{__('Anzahl')}}</th>
           <th>{{__('Marge')}}</th>
           <th class="text-right">{{__('EK-Preis')}}</th>
           <th class="text-right">{{__('Points')}}</th>
           <th class="text-right">{{__('Verdienst')}}</th>
           <th class="text-right">{{__('VK-Preis')}}</th>
       </tr>
       </thead>
       <tbody>
           @foreach($homeparty_guest->homeparty_user_order_items as $value)
               <tr>
                   <td>
                       @if(count($value->product->images))
                           <img class="img-fluid img-extra" alt="" src="{{ route('product_image', [$value->product->images->first()->slug]) }}">
                       @endif
                   </td>
                   <td class="min-width-80">
                       <strong>{{ $value->product->name }}</strong>
                       <div class="text-body">
                           <div>Inhalt: {{ $value->product->contents }}</div>
                           <div>Art.-Nr.: {{ $value->product->number }}</div>
                       </div>
                       @if(!$homeparty->completed)
                       <div class="options">
                            <a href="#" class="auto-delete-product remove_item_form_cart product-tooltip" data-order-item-id="{{$value->id}}"  data-product-id="{{ $value->product->id }}"><i class="fa fa-times"></i>  Artikel entfernen</a>
                        </div>
                       @endif
                   </td>
                   <td>
                       @if(!$homeparty->completed)
                       <div class="no-line-break input-group-min-w">
                           <div class="input-group d-inline-flex w-auto">
                           <span class="input-group-prepend">
                             <button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-from-basket" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}">-</button>
                           </span>
                               <input type="text" class="form-control text-center input-extra table-input-event-onchange" name="product_qty_{{$value->id}}" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}" value="{{$value->qty}}">
                               <span class="input-group-append">
                               <button type="button" class="btn btn-secondary icon-btn md-btn-extra add-from-basket" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}">+</button>
                           </span>
                           </div>
                       </div>
                       @else
                           {{$value->qty}}
                       @endif
                   </td>
                   <td>
                       {{ $value->margin }}%
                   </td>
                   <td class="text-right">
                       {{ $value->getFormattedTotalEKPrice() }} &euro;
                   </td>
                   <td class="text-right">
                       {{ $value->getFormattedTotalPoints() }}
                   </td>
                   <td class="text-right">
                       {{ $value->getFormattedTotalIncomePrice() }} &euro;
                   </td>
                   <td class="text-right">
                       {{ $value->getFormattedTotalPrice() }} &euro;
                   </td>
               </tr>
           @endforeach

       </tbody>
       <tfoot id="insert_show_bonus_host">
       @php($user_cart = \App\Services\HomepartyCart::getUserCart($homeparty_guest->id))
       @if(!$homeparty_guest->is_host)
           <tr class="foot-small">

               @if(!$homeparty_guest->isAddress())
                   <td colspan="3" class="border-top">
                       <p>Keine Lieferadresse angelegt  <a href="{{route('user_homeparty_guest_detail', [$homeparty_guest->homeparty->id, $homeparty_guest->id])}}"><i class="fa fa-edit"></i> </a></p>
                   <td colspan="5" class="border-top">&nbsp;</td>
               @else
               <td colspan="3" class="border-top">
                   @if(!$homeparty->completed)

                   <select class="custom-select select_delivery_option" name="select_delivery_option">
                       <option value="host" @if($homeparty_guest->getDelivery() === 'host') selected @endif>Lieferung an Gastgeber</option>
                       <option value="direct" @if($homeparty_guest->getDelivery() === 'direct') selected @endif>Lieferung direkt an den Gast</option>
                   </select>
                   @else
                       @if($homeparty_guest->getDelivery() === 'host') Lieferung an Gastgeber @endif
                       @if($homeparty_guest->getDelivery() === 'direct') Lieferung direkt an den Gast @endif
                   @endif
               </td>
               <td colspan="5" class="border-top">&nbsp;</td>
               @endif
           </tr>
           @if($homeparty_guest->getDelivery() === 'direct')
            <tr>
               <td colspan="5" class="text-left">Versandkosten</td>
               <td>&nbsp;</td>
               <td class="text-right">&nbsp;</td>
               <td class="text-right">{{$user_cart->getFormattedShippingPrice()}} &euro;</td>
           </tr>
            @endif

           <tr>
               <td colspan="4" class="border-top"><strong>Gesamt:</strong></td>
               <td class="border-top text-right"><strong>{{$user_cart->getFormattedEkPrice()}} &euro;</strong></td>
               <td class="border-top text-right"><strong>{{$user_cart->getFormattedPoints()}}</strong></td>
               <td class="border-top text-right"><strong>{{$user_cart->getFormattedIncomePrice()}} &euro;</strong></td>
               <td class="border-top text-right"><strong>{{$user_cart->getFormattedPrice()}} &euro;</strong></td>
           </tr>
           @else

           @include('user.homeparty.show_calc_bonus_host')

       @endif
       </tfoot>
   </table>
</div>
@endif