Sha256: 993e611697acb124563b9be610a436c4406a62a1022f5a0ba225480010d1b3f1

Contents?: true

Size: 1.93 KB

Versions: 3

Compression:

Stored size: 1.93 KB

Contents

<%= form_for :order, :url => populate_orders_url do |f| %>
<%= hook :inside_product_cart_form do %>
<div id="cart_wrapper">

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

  <% if @product.has_variants? %>
    <div id="product-variants">
    <% if defined?(SpreeEnhancedOptionTypes) %>
      <%= render :partial => (Spree::Config[:eot_presentation_type] || 'radio_sets'), :locals => {:f => f} %>
    <% else %>
      <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>
    <% end %>
    </div>
  <% end%>
  <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
    <%= hidden_field_tag (@product.has_variants? ? :quantity : "variants[#{@product.master.id}]"),
      1, :class => "title", :size => 3 %>
    &nbsp;
    <button type='submit' class='add-to-cart'>
      <%= t('add_to_cart') %>
    </button>
  <% else %>
    <%= content_tag('strong', t('out_of_stock')) %>
  <% end %>

</div>

<% end %>
<% end %>

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
synergy_default_theme-1.0.2 app/views/products/_cart_form.html.erb
synergy_default_theme-1.0.1 app/views/products/_cart_form.html.erb
synergy_default_theme-1.0.0 app/views/products/_cart_form.html.erb