<table class="table table-bordered">
  <thead>
    <th></th>
    <th>Produkt</th>
    <th>Cena jednostkowa</th>
    <th>Ilość</th>
    <th>Suma</th>
  </thead>
  <tbody>
    <% @order.order_products.each do |op| %>
    <tr>
      <td>
        <% if !op.product.images.blank? %>
          <%= image_tag(op.product.cover_image.image.url(:medium)) %>
        <% else %>
          <%= image_tag('kaktus.png', width: '60px') %>
        <% end %>
      </td>
      <td>
        <strong><%= op.product.name %></strong>
      </td>
      <td>PLN <%= format('%.2f', op.price) %></td>
      <td><%= op.quantity %></td>
      <td>PLN <%= format('%.2f', op.multiple_price) %></td>
    </tr>

    <% end %>
  </tbody>
  <tfoot>
    <tr>
      <th colspan="2"></th>
      <th colspan="2">Towar</th>
      <th>PLN <%= format('%.2f', @order.order_value) %></th>
    </tr>
    <tr>
      <th colspan="2"></th>
      <th colspan="2">Wysyłka</th>
      <th>PLN <%= format('%.2f', @order.shipping.price) %></th>
    </tr>
    <tr>
      <th colspan="2"></th>
      <th colspan="2">Razem do zapłaty</th>
      <th>PLN <%= format('%.2f', @order.order_summary) %></th>
    </tr>
  </tfoot>
</table>
