% if @prototype.option_types.present? %>
<%= Spree.t(:variants) %>
<% @prototype.option_types.each do |ot| %>
-
<%= check_box_tag "option_types[]", ot.id, (params[:option_types] || []).include?(ot.id.to_s), id: "option_type_#{ot.id}", class: "option-type" %>
<%= label_tag "option_type_#{ot.id}", ot.presentation %>
<% if Spree::OptionType.color&.name == ot.name %>
<% ot.option_values.each do |ov| %>
-
<%= label_tag "option_value_#{ov.id}" do %>
<%= check_box_tag "product[option_values_hash][#{ot.id}][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
<% end %>
<% end %>
<% else %>
<% ot.option_values.each do |ov| %>
-
<%= check_box_tag "product[option_values_hash][#{ot.id}][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
<%= label_tag "option_value_#{ov.id}", ov.presentation %>
<% end %>
<% end %>
<% end %>
<% end %>