Sha256: 98dde2b5c9ee723deda6c1dc1c73116ffb2743da89045c722baaf508d23d4c7d

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 KB

Contents

<% if current_products.empty? -%>
<h3><%= t 'bodega.empty_cart' %></h3>
<% else -%>
<%= form_for(current_order, url: root_path) do |form| %>
  <table id="bodega-cart">
    <thead>
      <tr><th class="product-name" colspan="2"><%= t 'bodega.product' %></th><th class="price"><%= t 'bodega.price' %></th><th class="total" colspan="2"><%= t 'bodega.total' %></th></tr>
    </thead>
    <tbody>
      <% current_order.order_products.each do |order_product| -%>
      <tr>
        <td class="quantity-field">
          <%= number_field_tag 'products[][quantity]', order_product.quantity, class: 'quantity', max: order_product.product.max_for_sale, min: 1 %>
        </td>
        <td class="product-name">
          <%= order_product.name %>
          <%= hidden_field_tag 'products[][type]', order_product.product_type %>
          <%= hidden_field_tag 'products[][id]', order_product.product_id %>
        </td>
        <td class="price">
          <%= humanized_money_with_symbol order_product.price %>
        </td>
        <td class="subtotal">
          <%= humanized_money_with_symbol order_product.subtotal %>
        </td>
        <td class="remove">
          <%= link_to t('bodega.remove'), bodega.remove_path(product_id: order_product.identifier) %>
        </td>
      </tr>
      <% end -%>
      <tr>
        <td colspan="3"></td>
        <td><%= humanized_money_with_symbol current_order.subtotal %></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <%= button_tag t('bodega.update_cart'), id: 'bodega-update', name: :update, value: 1 %>
  <%= button_tag t('bodega.checkout'), id: 'bodega-checkout', name: :checkout, value: 1 %>
<% end =%>
<% end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bodega-0.3.0 app/views/bodega/orders/new.html.erb