Sha256: 5abd1a670bf3cb043552bd7a97750739bc0743b8070ca1ebd855595c9656058a

Contents?: true

Size: 943 Bytes

Versions: 3

Compression:

Stored size: 943 Bytes

Contents

<% if object.reflections.keys.include?(:variants) -%>
	<script type="text/javascript">
		var variant_map = <%= raw variant_map(object) %>;
	</script>

	<div class="variant_options">
		<% options_for_klass(object.class).each do |option| -%>
		<div class="option" id="option_<%= option.id %>">
		<h4><%= option.name %></h4>
		<%= select_tag option.name, options_for_select(option.option_values.map{ |o| [o.name, o.id] }), include_blank: true %>
		<br />
		</div>
		<% end -%>
		<span class="all_selected">You must select a choice from each option.</span>
		<span class="unavailable">This combination is not available.</span>
		<%= form_tag piggybak.cart_add_url do -%>
		<input type="hidden" id="sellable_id" name="sellable_id" />
		<div id="variant_price">Price: <span></span></div>
		<label for="quantity">Quantity</label>
		<%= text_field_tag :quantity, 1 %>
		<%= submit_tag "Add to Cart", :id => "submit" %>
		<% end -%>
	</div>
<% end -%>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
piggybak_variants-0.1.2 app/views/piggybak_variants/cart/_dropdowns_form.html.erb
piggybak_variants-0.1.1 app/views/piggybak_variants/cart/_dropdowns_form.html.erb
piggybak_variants-0.1.0 app/views/piggybak_variants/cart/_dropdowns_form.html.erb