<%= f.field_container :name, class: ['form-group'] do %> <%= f.label :name, raw(Spree.t(:name) + content_tag(:span, ' *', class: 'required')) %> <%= f.text_field :name, class: 'form-control title' %> <%= f.error_message_on :name %> <% end %>
<%= f.field_container :slug, class: ['form-group'] do %> <%= f.label :slug, raw(Spree.t(:slug) + content_tag(:span, ' *', class: "required")) %> <%= f.text_field :slug, class: 'form-control title' %> <%= f.error_message_on :slug %> <% end %>
<%= f.field_container :description, class: ['form-group'] do %> <%= f.label :description, Spree.t(:description) %> <%= f.text_area :description, { rows: "#{unless @product.has_variants? then '20' else '13' end}", class: 'form-control' } %> <%= f.error_message_on :description %> <% end %>
<%= f.field_container :price, class: ['form-group'] do %> <%= f.label :price, raw(Spree.t(:master_price) + content_tag(:span, ' *', class: "required")) %> <%= f.text_field :price, value: number_to_currency(@product.price, unit: ''), class: 'form-control', disabled: (cannot? :update, Spree::Price) %> <%= f.error_message_on :price %> <% end %>
<%= f.field_container :cost_price, class: ['form-group'] 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, class: ['form-group'] do %> <%= f.label :cost_currency, Spree.t(:cost_currency) %> <%= f.text_field :cost_currency, class: 'form-control' %> <%= f.error_message_on :cost_currency %> <% end %>
<%= f.field_container :available_on, class: ['form-group'] 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), class: 'datepicker form-control' %> <% end %>
<% if @product.has_variants? %>
<%= f.label :skus, Spree.t(:sku).pluralize %>
<%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.count) %>
    <% @product.variants.first(5).each do |variant| %>
  • <%= variant.sku %>
  • <% 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 'variants', 'Manage Variants', spree.admin_product_variants_url(@product), class: "btn btn-default" %> <% end %>
<% else %>
<%= f.field_container :sku, class: ['form-group'] do %> <%= f.label :sku, Spree.t(:sku) %> <%= f.text_field :sku, size: 16, class: 'form-control' %> <% end %>
<%= f.label :weight, Spree.t(:weight) %> <%= f.text_field :weight, size: 4, class: 'form-control' %>
<%= f.label :height, Spree.t(:height) %> <%= f.text_field :height, size: 4, class: 'form-control' %>
<%= f.label :width, Spree.t(:width) %> <%= f.text_field :width, size: 4, class: 'form-control' %>
<%= f.label :depth, Spree.t(:depth) %> <%= f.text_field :depth, size: 4, class: 'form-control' %>
<% end %>
<%= f.field_container :shipping_categories, class: ['form-group'] do %> <%= f.label :shipping_category_id, Spree.t(:shipping_categories) %> <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2', disabled: (cannot? :edit, Spree::ShippingCategory) }) %> <%= f.error_message_on :shipping_category %> <% end %>
<%= f.field_container :tax_category, class: ['form-group'] 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', disabled: (cannot? :edit, Spree::TaxCategory) }) %> <%= f.error_message_on :tax_category %> <% end %>
<%= f.field_container :taxons, class: ['form-group'] do %> <%= f.label :taxon_ids, Spree.t(:taxons) %> <% if can? :modify, Spree::Classification %> <%= f.hidden_field :taxon_ids, value: @product.taxon_ids.join(',') %> <% elsif @product.taxons.any? %> <% else %>
<%= Spree.t(:no_resource_found, resource: :taxons) %>
<% end %> <% end %>
<%= f.field_container :option_types, class: ['form-group'] do %> <%= f.label :option_type_ids, Spree.t(:option_types) %> <% if can? :modify, Spree::OptionType %> <%= f.hidden_field :option_type_ids, value: @product.option_type_ids.join(',') %> <% elsif @product.option_types.any? %> <% else %>
<%= Spree.t(:no_resource_found, resource: :option_types) %>
<% end %> <% end %>
<%= f.field_container :meta_keywords, class: ['form-group'] do %> <%= f.label :meta_keywords, Spree.t(:meta_keywords) %> <%= f.text_field :meta_keywords, class: 'form-control' %> <% end %>
<%= f.field_container :meta_description, class: ['form-group'] do %> <%= f.label :meta_description, Spree.t(:meta_description) %> <%= f.text_field :meta_description, class: 'form-control' %> <% end %>
<% unless Rails.env.test? %> <% end %>