diff --git a/app/controllers/spree/admin/products_controller_decorator.rb b/app/controllers/spree/admin/products_controller_decorator.rb index ef4b28deaa..9be7949898 100644 --- a/app/controllers/spree/admin/products_controller_decorator.rb +++ b/app/controllers/spree/admin/products_controller_decorator.rb @@ -151,4 +151,8 @@ Spree::Admin::ProductsController.class_eval do variant.on_demand = on_demand if on_demand.present? variant.on_hand = on_hand.to_i if on_hand.present? end + + def set_product_master_variant_price_to_zero + @product.price = 0 if @product.price.nil? + end end diff --git a/app/views/spree/admin/products/_form.html.haml b/app/views/spree/admin/products/_form.html.haml index b41b858c42..0104afceba 100644 --- a/app/views/spree/admin/products/_form.html.haml +++ b/app/views/spree/admin/products/_form.html.haml @@ -46,11 +46,6 @@ = f.collection_select(:supplier_id, @producers, :id, :name, {:include_blank => true}, {:class => "select2"}) = f.error_message_on :supplier - = f.field_container :price do - = f.label :price, raw(t(:price) + content_tag(:span, ' *', :class => 'required')) - = f.text_field :price, :value => number_to_currency(@product.price, :unit => '') - = f.error_message_on :price - .clear - unless @product.has_variants?