<% if order.line_items.exists? %>
  <table class="line-items index" data-hook="line-items">
    <thead>
      <th colspan="2"><%= Spree::LineItem.human_attribute_name(:name) %></th>
      <th><%= Spree::LineItem.human_attribute_name(:price) %></th>
      <th><%= Spree::LineItem.human_attribute_name(:quantity) %></th>
      <th><%= Spree::LineItem.human_attribute_name(:total_price) %></th>
    </thead>

    <tbody>
      <% order.line_items.each do |item| %>
        <tr class="line-item" id="line-item-<%= item.id %>">
          <td class="line-item-image">
            <%= render 'spree/admin/shared/image',
              image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
              size: :mini %>
          </td>
          <td class="line-item-name">
            <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
          </td>
          <td class="line-item-price">
            <%= item.single_money.to_html %>
          </td>
          <td class="line-item-qty-show">
            <%= item.quantity %>
          </td>
          <td class="line-item-total">
            <%= item.display_amount %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% end %>
