Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
removing reference to product.js
  • Loading branch information
hnprashanth committed Mar 18, 2011
1 parent eacb760 commit e079a8b
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions app/views/products/_cart_form.html.erb
@@ -0,0 +1,50 @@
<%= 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 %>

0 comments on commit e079a8b

Please sign in to comment.