Saturday, 17 August 2013

Spree, Ruby on Rails - Add to cart multiple variants of the same product

Spree, Ruby on Rails - Add to cart multiple variants of the same product

I want customers to be allowed to add multiple variants of the same
product on the same page. Now i have a list of variants with a radio
button, how to make them checkboxes? Of course, changing
"radio_button_tag" to "check_box_tag" not helping
<% @product.variants_and_option_values(current_currency).each_with_index
do |variant, index| %>
<%= radio_button_tag "products[#{@product.id}]", variant.id, index == 0,
'data-price' => variant.price_in(current_currency).display_price %>
<%= variant_options variant %>
<% end%>

No comments:

Post a Comment