Producto
<%= link_to products_path(:filter => @filter, :current_page => @current_page), {:class=>"fr-space btn blue-hoki "} do %>
Regresar
<% end %>
<%= notice %>
<%= form_tag(product_update_variants_path(@product.id), :multipart => true, :class => "form-horizontal", :id => "form") do |f| %>
<% unless @product.parent_id.nil? %>
<% end %>
<% if current_user.usertype == "A" %>
<% end %>
<% if @product.sizes.count > 0 %>
<%= hidden_field_tag :variants %>
<% end %>
Modificar variantes del producto
SKU:
<%= @product.sku %>
Producto:
<%= @product.name %>
Presentacion:
<%= @product.display_attributes %>
Descripcion:
<%= @product.description %>
Unidad de medida:
<%= @product.unit.unit %>
Status:
<% if @product.status == "active" %> Activo <% else %> Inactivo <% end %>
Inventariado:
<% if @product.inventory %> Si <% else %> No <% end %>
CategorÃas:
<% @product.categories.each_with_index do | cat, index | %>
<% if index > 0 %>
<% end %> <%= cat.category %> <% end %>
<% end %> <%= cat.category %> <% end %>
Precio compra:
<%= (@product.is_in_dollars? ? "#{number_to_currency(@product.price_base_dollars, precision: 2)} USD" : "#{number_to_currency(@product.price_base, precision: 2)} MXN") %>
Precio venta base:
$ <%= @product.price_sale %>
Variantes
<%= label_tag :size_list, "Tallas", {:class=>"col-md-3 control-label"} %>
<% end %>
<% if @product.colors.count > 0 %>
<% @product.sizes.each_with_index do |s, i| %>
<%= text_field_tag "#{s.id}", s.name, :class => "form-control input-medium margin-bottom-10 sizes" %>
<% end %>
<%= hidden_field_tag "new_size_list", @product.sizes.to_json.to_s %>
<%= label_tag :color_list, "Colores", {:class=>"col-md-3 control-label"} %>
<% end %>
<% if @product.styles.count > 0 %>
<% @product.colors.each_with_index do |s, i| %>
<%= text_field_tag "#{s.id}", s.name, :class => "form-control input-medium margin-bottom-10 colors" %>
<% end %>
<%= hidden_field_tag "new_color_list", @product.colors.to_json %>
<%= label_tag :style_list, "Estilos", {:class=>"col-md-3 control-label"} %>
<% end %>
<% @product.styles.each_with_index do |s, i| %>
<%= text_field_tag "#{s.id}", s.name, :class => "form-control input-medium margin-bottom-10 styles" %>
<% end %>
<%= hidden_field_tag "new_style_list", @product.styles.to_json %>
<%= submit_tag 'Guardar', {:class=>"btn green"} %>
<%= link_to 'Cancelar', products_path(:filter => @filter, :current_page => @current_page), {:class=>"btn default"} %>