<%= f.field_container :name do %> <%= f.label :name, class: 'required' %> <%= f.text_field :name, class: 'fullwidth title', required: true %> <%= f.error_message_on :name %> <% end %>
<%= f.field_container :slug do %> <%= f.label :slug, class: 'required' %> <%= f.text_field :slug, class: 'fullwidth title', required: true %> <%= f.error_message_on :slug %> <% end %>
<%= f.field_container :description do %> <%= f.label :description %> <%= f.text_area :description, {rows: "#{unless @product.has_variants? then '22' else '15' end}", class: 'fullwidth'} %> <%= f.error_message_on :description %> <% end %>
<%= f.field_container :price do %> <%= f.label :price, class: 'required' %> <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency: @product.find_or_build_master.default_price.currency %> <%= f.error_message_on :price %> <% end %>
<% if show_rebuild_vat_checkbox? %> <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product" %>
<% end %>
<%= f.field_container :cost_price do %> <%= f.label :cost_price %> <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :cost_price, currency_attr: :cost_currency %> <%= f.error_message_on :cost_price %> <%= f.error_message_on :cost_currency %> <% end %>
<%= f.field_container :available_on do %> <%= f.label :available_on %> <%= f.error_message_on :available_on %> <%= f.text_field :available_on, value: datepicker_field_value(@product.available_on), class: 'datepicker' %> <% end %>
<%= f.field_container :promotionable do %> <%= f.label :promotionable do %> <%= f.check_box :promotionable %> <%= Spree::Product.human_attribute_name(:promotionable) %> <% end %> <%= f.field_hint :promotionable %> <% end %>
<% if @product.has_variants? %>
<%= f.label :skus, Spree.t(:skus) %> <%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.count) %>
    <% @product.variants.first(5).each do |variant| %>
  • <%= link_to variant.sku, spree.edit_admin_product_variant_path(@product, variant) %>
  • <% end %>
<% if @product.variants.count > 5 %> <%= Spree.t(:info_number_of_skus_not_shown, count: @product.variants.count - 5) %> <% end %>
<% if can?(:admin, Spree::Variant) %> <%= link_to_with_icon 'th-large', Spree.t(:manage_variants), admin_product_variants_url(@product) %> <% end %>
<% else %>
<%= f.field_container :sku do %> <%= f.label :sku, Spree::Variant.human_attribute_name(:sku) %> <%= f.text_field :sku, size: 16 %> <% end %>
<% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
<%= f.label field %> <%= f.text_field field, value: number_with_precision(@product.send(field), precision: 2) %>
<% end %>
<% end %>
<%= f.field_container :shipping_categories do %> <%= f.label :shipping_category_id, Spree::ShippingCategory.model_name.human %> <%= f.field_hint :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::TaxCategory.model_name.human %> <%= f.field_hint :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 %>
<%= f.field_container :taxons do %> <%= f.label :taxon_ids, plural_resource_name(Spree::Taxon) %>
<%= f.hidden_field :taxon_ids, value: @product.taxon_ids.join(',') %> <% end %>
<%= f.field_container :option_types do %> <%= f.label :option_type_ids, plural_resource_name(Spree::OptionType) %> <%= f.hidden_field :option_type_ids, value: @product.option_type_ids.join(',') %> <% end %>
<%= f.field_container :meta_title do %> <%= f.label :meta_title %> <%= f.text_field :meta_title, class: 'fullwidth' %> <% end %>
<%= f.field_container :meta_keywords do %> <%= f.label :meta_keywords %> <%= f.text_field :meta_keywords, class: 'fullwidth' %> <% end %>
<%= f.field_container :meta_description do %> <%= f.label :meta_description %> <%= f.text_field :meta_description, class: 'fullwidth' %> <% end %>