%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :variants} %> <%# Place for new variant form %>
<% if @variants.any? %><%= Spree.t(:options) %> | <%= Spree.t(:price) %> | <%= Spree.t(:sku) %> | ||
---|---|---|---|---|
<% if can? :edit, variant %> <% end %> | <%= variant.options_text %> | <%= variant.display_price.to_html %> | <%= variant.sku %> | <%= link_to_edit(variant, no_text: true) if can?(:edit, variant) && !variant.deleted? %> <%= link_to_delete(variant, no_text: true) if can?(:destroy, variant) && !variant.deleted? %> |
<%= Spree.t(:none) %> |
<%= Spree.t(:to_add_variants_you_must_first_define) %> <%= link_to(Spree.t(:option_types), spree.admin_product_url(@product)) %> <% if can?(:display, Spree::OptionType) && can?([:create, :display], Spree::OptionValue) %> <%= Spree.t(:and) %> <%= link_to Spree.t(:option_values), spree.admin_option_types_url %> <% end %>
<% end %> <% else %> <% content_for :page_actions do %> <%= button_link_to(Spree.t(:new_variant), spree.new_admin_product_variant_url(@product), { remote: :true, icon: 'add', :'data-update' => 'new_variant', class: 'btn-success', id: 'new_var_link' }) if can? :create, Spree::Variant %> <%= button_link_to (@deleted.blank? ? Spree.t(:show_deleted) : Spree.t(:show_active)), spree.admin_product_variants_url(@product, deleted: @deleted.blank? ? "on" : "off"), { class: 'btn-default', icon: 'filter' } %> <% end %> <% end %>