diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index 9aae19e015..7f1f9e63f4 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -36,6 +36,8 @@ module Spree redirect_to spree.admin_products_path end else + # Re-fill the form with deleted params on product + @on_hand = request.params[:product][:on_hand] render :new end end diff --git a/app/views/spree/admin/products/new.html.haml b/app/views/spree/admin/products/new.html.haml index 28adb4b815..154793f6cb 100644 --- a/app/views/spree/admin/products/new.html.haml +++ b/app/views/spree/admin/products/new.html.haml @@ -77,7 +77,7 @@ = f.field_container :on_hand do = f.label :on_hand, t(".on_hand") %br/ - = f.text_field :on_hand, class: 'fullwidth' + = f.text_field :on_hand, class: 'fullwidth', value: @on_hand = f.error_message_on :on_hand .three.columns.omega = f.field_container :on_demand do