Sha256: 3f2a981112bdbabc5f8b01ea9334ec8e2d83e3b6a445c41acec00f485dfd93ab

Contents?: true

Size: 1011 Bytes

Versions: 3

Compression:

Stored size: 1011 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>
		<% option.option_values.each do |option_value| -%>
			<input type="radio" name="option_<%= option.id %>" value="<%= option_value.id %>" />
			<%= option_value.name %><br />
		<% end -%>
		<br />
		</div>
		<% end -%>
		<span class="all_selected">You must select an 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/_radio_buttons_form.html.erb
piggybak_variants-0.1.1 app/views/piggybak_variants/cart/_radio_buttons_form.html.erb
piggybak_variants-0.1.0 app/views/piggybak_variants/cart/_radio_buttons_form.html.erb