<%= field_set_tag t('activerecord.attributes.order.option_values') do %>
<%= f.hidden_field :product_id, value: @product.id %>
<% @product.option_types.each do |option_type| %>
<%= f.label option_type.name %>
<%= content_tag :i, '',
class: 'fa fa-info show-popover text-info',
title: option_type.hint,
data: { toggle: 'popover', placement: 'top' } unless option_type.hint.blank? %>
<%= f.input :option_value_ids,
input_html: {
name: "order[option_value_ids][]",
title: option_type.hint.blank? ? nil : option_type.hint,
data: {
id: option_type.id
}
},
label: false,
as: :select,
include_blank: (t('helpers.select.prompt') if option_type.option_values.uniq.count > 1),
collection: option_type.option_values.uniq
%>
<% end %>
<% end %>
<%= field_set_tag t('site.complete_your_order') do %>
<%= f.input :quantity %>
<%= f.input :address, input_html: { value: ( find_address order.address ) } %>
<%= f.input :comment, input_html: { rows: 3 } %>
<% end %>
<% if @product.price_conditions.blank? %>
<%= t('site.products.price') %>
<%= number_to_currency @product.price %>
<%= button_tag(type: :submit, class: 'btn btn-primary mb-20') do %>
<%= t('helpers.submit.create', {model: t('activerecord.models.order.one')}) %>
<% end %>
<% else %>
<%= t('site.products.price_from') %>
<%= number_to_currency @product.price %>
<%= button_tag(type: :submit, class: 'btn btn-primary mb-20') do %>
<%= t('helpers.submit.create', {model: t('activerecord.models.order.one')}) %>
<% end %>
<%= raw @product.price_conditions %>
<% end %>