Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
removing reference to product.js
- Loading branch information
1 parent
eacb760
commit e079a8b
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> | ||
| ||
<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 %> |