<%= form_tag url_for(action: :save_product_attributes), class: 'panel panel-default', id: 'ecommerce_product_attributes', 'data-confirm-msg' => t('.confirm_delete', default: 'Are you sure to delete?') do %>

<%= t('.title', default: 'Product Attributes') %>

<% (current_site.product_attributes.to_a + [Plugins::Ecommerce::Attribute.new]).each_with_index do |attr, index| %>

 

<%= text_field_tag "attribute_names[#{attr.id}][label]", attr.label, class: 'form-control translatable required' %>

*
*
    <% (attr.values.to_a + (attr.id.present? ? [] : [Plugins::Ecommerce::Attribute.new])).each do |value| %>
  • <%= hidden_field_tag "attribute[#{attr.id}][][position]", value.position, class: 'value_position' %> <%= hidden_field_tag "attribute[#{attr.id}][][id]", value.id %>
    <%= text_field_tag "attribute[#{attr.id}][][key]", value.key, class: 'form-control slug required', "data-parent" => "category_name", style: "#{'margin-top: 47px;' if current_site.get_languages.count > 1 }" %>
    <%= text_field_tag "attribute[#{attr.id}][][value]", value.label, class: 'form-control required translatable' %>
  • <% end %>
<%= t('.add_new_value', default: 'Add new value') %>
<% end %>
<% end %>