Sha256: 235cd53268bd57a04c49256146d1e811dfa7bbba7edf2494f1789bbc0715ef7c

Contents?: true

Size: 1.79 KB

Versions: 34

Compression:

Stored size: 1.79 KB

Contents

<%= form_for :order, :url => populate_orders_url do |f| %>
<%= hook :inside_product_cart_form do %>

  <% if product_price(@product) %>
    <%= hook :product_price do %>
      <p class="prices">
        <%= t("price") %>
        <br />
        <span class="price selling"><%= product_price(@product) %></span>
      </p>
    <% end %>
  <% end %>

  <% if @product.has_variants? %>
    <div id="product-variants">
      <h2><%= t('variants') %></h2>
      <ul>
        <%  has_checked = false
        @product.variants.active.each_with_index do |v,index|
          next if v.option_values.empty? || (!v.in_stock && !Spree::Config[:show_zero_stock_products])
          checked = !has_checked && (v.in_stock || Spree::Config[:allow_backorders])
          has_checked = true if checked %>
          <li>
            <label>
              <%= radio_button_tag "products[#{@product.id}]", v.id, checked, :disabled => !v.in_stock && !Spree::Config[:allow_backorders] %>
              <span class="variant-description">
                <%= variant_options v %>
              </span>
              <% if variant_price_diff v %>
                <span class="price diff"><%= variant_price_diff v %></span>
              <% end %>
            </label>
          </li>
        <% end%>
      </ul>
    </div>
  <% end%>
  <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
    <%= text_field_tag (@product.has_variants? ? :quantity : "variants[#{@product.master.id}]"),
      1, :class => "title", :size => 3 %>
    &nbsp;
    <button type='submit' class='large primary'>
      <%= image_tag('/images/add-to-cart.png') + t('add_to_cart') %>
    </button>
  <% else %>
    <%= content_tag('strong', t('out_of_stock')) %>
  <% end %>

<% end %>
<% end %>

<% content_for :head do %>
  <%= javascript_include_tag 'product' %>
<% end %>

Version data entries

34 entries across 28 versions & 6 rubygems

Version Path
apispree_core-0.0.0 app/views/products/_cart_form.html.erb~
apispree_core-0.0.0 app/views/products/_cart_form.html.erb
My-Commerce_core-1.1.0 app/views/products/_cart_form.html.erb~
My-Commerce_core-1.1.0 app/views/products/_cart_form.html.erb
My-Commerce_core-1.0.0 app/views/products/_cart_form.html.erb
My-Commerce_core-1.0.0 app/views/products/_cart_form.html.erb~
MyCommerceapi-1.0.0 core/app/views/products/_cart_form.html.erb~
MyCommerceapi-1.0.0 core/app/views/products/_cart_form.html.erb
MyCommerce-0.0.3 core/app/views/products/_cart_form.html.erb
MyCommerce-0.0.3 core/app/views/products/_cart_form.html.erb~
rfcommerce_core-0.0.3 app/views/products/_cart_form.html.erb~
rfcommerce_core-0.0.3 app/views/products/_cart_form.html.erb
spree_core-0.60.6 app/views/products/_cart_form.html.erb
spree_core-0.60.5 app/views/products/_cart_form.html.erb
spree_core-0.30.2 app/views/products/_cart_form.html.erb
spree_core-0.40.4 app/views/products/_cart_form.html.erb
spree_core-0.50.4 app/views/products/_cart_form.html.erb
spree_core-0.60.4 app/views/products/_cart_form.html.erb
spree_core-0.50.3 app/views/products/_cart_form.html.erb
spree_core-0.60.3 app/views/products/_cart_form.html.erb