Sha256: 5e5a5d4bf9c4c5197a104853fd7edb5f378575bcbdeecb0a1018edc641a77777

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

<% variant = line_item.variant %>

<%= order_form.fields_for :line_items, line_item do |item_form| %>
  <article class="cart-item">
    <div class="cart-item__image">
      <%= link_to(
        render(
          'spree/shared/image',
          image: variant.gallery.images.first || variant.product.gallery.images.first,
          size: :small
        ),
        variant.product
      ) %>
    </div>

    <section class="cart-item__info">
      <%= render(
        'spree/components/cart/item_info',
        line_item: line_item,
        variant: variant
      ) %>
    </section>

    <div class="cart-item__price-single">
      <%= line_item.single_money.to_html %>
    </div>

    <div class="cart-item__quantity">
      <%= render(
        'spree/components/forms/inputs/text',
        id: "order_line_items_attributes_#{item_form.options[:child_index]}_quantity",
        min: 0,
        name: "order[line_items_attributes][#{item_form.options[:child_index]}][quantity]",
        type: :number,
        value: line_item.quantity
      ) %>
    </div>

    <div class="cart-item__price">
      <strong><%= line_item.display_amount.to_html unless line_item.quantity.nil? %></strong>
    </div>

    <div class="cart-item__remove">
      <%= submit_tag(
        'Remove',
        class: 'delete',
        id: "delete_#{dom_id(line_item)}",
        data: { disable_with: 'Remove' }
      ) %>
    </div>
  </article>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_starter_frontend-0.1.0 app/views/spree/components/cart/_cart_item.html.erb