<%= f.field_container :name do %>
<%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
<%= f.text_field :name, class: 'form-control title' %>
<%= f.error_message_on :name %>
<% end %>
<%= f.field_container :slug do %>
<%= f.label :slug, raw(Spree.t(:slug) + required_span_tag) %>
<%= f.text_field :slug, class: 'form-control title' %>
<%= f.error_message_on :slug %>
<% end %>
<%= f.field_container :description do %>
<%= f.label :description, Spree.t(:description) %>
<%= f.text_area :description, { rows: "#{unless @product.has_variants? then '29' else '30' end}", class: "form-control #{"spree-rte" if product_wysiwyg_editor_enabled? }" } %>
<%= f.error_message_on :description %>
<% end %>
<%= f.field_container :price do %>
<%= f.label :price, raw(Spree.t(:master_price) + required_span_tag) %>
<%= f.error_message_on :price %>
<% end %>
<%= f.field_container :compare_at_price do %>
<%= f.label :compare_at_price, Spree.t(:compare_at_price) %>
<%= f.error_message_on :compare_at_price %>
<% end %>
<%= f.field_container :cost_price do %>
<%= f.label :cost_price, Spree.t(:cost_price) %>
<%= f.text_field :cost_price, value: number_to_currency(@product.cost_price, unit: ''), class: 'form-control' %>
<%= f.error_message_on :cost_price %>
<% end %>
<%= f.field_container :cost_currency do %>
<%= f.label :cost_currency, Spree.t(:cost_currency) %>
<%= f.select :cost_currency, currency_options(@product.cost_currency), {}, { class: 'select2' } %>
<%= f.error_message_on :cost_currency %>
<% end %>
<%= f.field_container :available_on do %>
<%= f.label :available_on, Spree.t(:available_on) %>
<%= f.error_message_on :available_on %>
<%= f.text_field :available_on,
value: datepicker_field_value(@product.available_on),
placeholder: Spree.t(:select_a_date),
class: 'form-control shadow-none ',
'data-input':'' %>
<%= render partial: 'spree/admin/shared/cal_close' %>
<% end %>
<%= f.field_container :discontinue_on do %>
<%= f.label :discontinue_on, Spree.t(:discontinue_on) %>
<%= f.error_message_on :discontinue_on %>
<%= f.text_field :discontinue_on,
value: datepicker_field_value(@product.discontinue_on),
placeholder: Spree.t(:select_a_date),
class: 'form-control shadow-none ',
'data-input':'' %>
<%= render partial: 'spree/admin/shared/cal_close' %>
<% end %>
<%= f.field_container :promotionable do %>
<%= f.check_box :promotionable %>
<%= f.label :promotionable, Spree.t(:promotionable) %>
<%= f.error_message_on :promotionable %>
<% end %>
<%= f.field_container :master_sku do %>
<%= f.label :master_sku, Spree.t(:master_sku) %>
<%= f.text_field :sku, size: 16, class: 'form-control' %>
<% end %>
<% if @product.has_variants? %>
<%= f.label :skus, Spree.t(:sku).pluralize %>
<%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.size) %>
<% @product.variants.first(5).each do |variant| %>
- <%= variant.sku %>
<% end %>
<% if @product.variants.size > 5 %>
<%= Spree.t(:info_number_of_skus_not_shown, count: @product.variants.size - 5) %>
<% end %>
<% if can?(:admin, Spree::Variant) %>
<%= link_to_with_icon 'adjust.svg', Spree.t(:manage_variants), spree.admin_product_variants_url(@product), class: "btn btn-outline-secondary" %>
<% end %>
<% else %>
<%= f.label :weight, Spree.t(:weight) %>
<%= f.text_field :weight, value: number_with_precision(@product.weight, precision: 2), size: 4, class: 'form-control' %>
<%= f.label :height, Spree.t(:height) %>
<%= f.text_field :height, value: number_with_precision(@product.height, precision: 2), size: 4, class: 'form-control' %>
<%= f.label :width, Spree.t(:width) %>
<%= f.text_field :width, value: number_with_precision(@product.width, precision: 2), size: 4, class: 'form-control' %>
<%= f.label :depth, Spree.t(:depth) %>
<%= f.text_field :depth, value: number_with_precision(@product.depth, precision: 2), size: 4, class: 'form-control' %>
<% end %>
<%= f.field_container :shipping_category do %>
<%= f.label :shipping_category_id, Spree.t(:shipping_category) %>
<%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2' }) %>
<%= f.error_message_on :shipping_category %>
<% end %>
<%= f.field_container :tax_category do %>
<%= f.label :tax_category_id, Spree.t(:tax_category) %>
<%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2' }) %>
<%= f.error_message_on :tax_category %>
<% end %>