diff --git a/app/views/spree/admin/prices/_variant_prices.html.erb b/app/views/spree/admin/prices/_variant_prices.html.erb index d7762f3ef6..6d05a07d8b 100644 --- a/app/views/spree/admin/prices/_variant_prices.html.erb +++ b/app/views/spree/admin/prices/_variant_prices.html.erb @@ -22,10 +22,10 @@ <%= variant.sku %> <%= label_tag "vp[#{variant.id}][#{code}]", code %> - <%= text_field_tag "vp[#{variant.id}][#{code}][price]", (price && price.price ? price.display_amount.money : ''), class: 'form-control' %> + <%= number_field_tag "vp[#{variant.id}][#{code}][price]", (price && price.price ? price.display_amount.money : ''), step: 0.01, min: 0, class: 'form-control' %> - <%= text_field_tag "vp[#{variant.id}][#{code}][compare_at_price]", (price && price.compare_at_price ? price.display_compare_at_amount.money : ''), class: 'form-control' %> + <%= number_field_tag "vp[#{variant.id}][#{code}][compare_at_price]", (price && price.compare_at_price ? price.display_compare_at_amount.money : ''), step: 0.01, min: 0, class: 'form-control' %> <% end %> diff --git a/app/views/spree/admin/products/_form.html.erb b/app/views/spree/admin/products/_form.html.erb index e008970316..6fc62ac68c 100644 --- a/app/views/spree/admin/products/_form.html.erb +++ b/app/views/spree/admin/products/_form.html.erb @@ -30,12 +30,12 @@
<%= f.field_container :price do %> - <%= f.label :price, raw(Spree.t(:master_price) + required_span_tag) %> + <%= f.label :price, raw(Spree.t(:price) + required_span_tag) %>
<%= currency_symbol(current_currency) %>
- <%= f.text_field :price, value: number_to_currency(@product.amount_in(current_currency), unit: ''), class: 'form-control', disabled: (cannot? :update, @product.master.default_price) %> + <%= f.number_field :price, value: number_to_currency(@product.amount_in(current_currency), delimiter: '', unit: ''), step: 0.01, min: 0, class: 'form-control', required: :required, disabled: (cannot? :update, @product.master.default_price) %>
<%= f.error_message_on :price %> <% end %> @@ -48,7 +48,7 @@
<%= currency_symbol(current_currency) %>
- <%= f.text_field :compare_at_price, value: number_to_currency(@product.compare_at_amount_in(current_currency), unit: ''), class: 'form-control' %> + <%= f.number_field :compare_at_price, value: number_to_currency(@product.compare_at_amount_in(current_currency), delimiter: '', unit: ''), step: 0.01, min: 0, class: 'form-control' %>
<%= f.error_message_on :compare_at_price %> <% end %> @@ -57,7 +57,7 @@
<%= f.field_container :cost_price 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.number_field :cost_price, value: number_to_currency(@product.cost_price, delimiter: '', unit: ''), step: 0.01, min: 0, class: 'form-control' %> <%= f.error_message_on :cost_price %> <% end %>
diff --git a/app/views/spree/admin/products/index.html.erb b/app/views/spree/admin/products/index.html.erb index 891cd9fbef..83ca872c90 100644 --- a/app/views/spree/admin/products/index.html.erb +++ b/app/views/spree/admin/products/index.html.erb @@ -58,7 +58,7 @@ <%= Spree.t('admin.digitals.digital') %> <%= Spree.t(:status) %> - <%= sort_link @search, :master_default_price_amount, Spree.t(:master_price), {}, {title: 'admin_products_listing_price_title'} %> + <%= sort_link @search, :master_default_price_amount, Spree.t(:price), {}, {title: 'admin_products_listing_price_title'} %> diff --git a/app/views/spree/admin/products/new.html.erb b/app/views/spree/admin/products/new.html.erb index 98dbf61091..0b2eb6f713 100644 --- a/app/views/spree/admin/products/new.html.erb +++ b/app/views/spree/admin/products/new.html.erb @@ -33,12 +33,12 @@
<%= f.field_container :price do %> - <%= f.label :price, raw(Spree.t(:master_price) + required_span_tag) %> + <%= f.label :price, raw(Spree.t(:price) + required_span_tag) %>
<%= currency_symbol(current_currency) %>
- <%= f.text_field :price, value: number_to_currency(@product.price, unit: ''), class: 'form-control', required: :required %> + <%= f.number_field :price, value: number_to_currency(@product.price, unit: ''), step: 0.01, min: 0, class: 'form-control', required: :required %>
<%= f.error_message_on :price %> <% end %>