diff --git a/lib/spree/core/product_duplicator.rb b/lib/spree/core/product_duplicator.rb index a99419bc19..82837bf3a6 100644 --- a/lib/spree/core/product_duplicator.rb +++ b/lib/spree/core/product_duplicator.rb @@ -24,6 +24,7 @@ module Spree new_product.created_at = nil new_product.deleted_at = nil new_product.updated_at = nil + new_product.price = 0 new_product.unit_value = %w(weight volume).include?(product.variant_unit) ? 1.0 : nil new_product.product_properties = reset_properties new_product.image = duplicate_image(product.image) if product.image diff --git a/spec/lib/spree/core/product_duplicator_spec.rb b/spec/lib/spree/core/product_duplicator_spec.rb index 08a8d9364e..265f2e1d53 100644 --- a/spec/lib/spree/core/product_duplicator_spec.rb +++ b/spec/lib/spree/core/product_duplicator_spec.rb @@ -71,6 +71,7 @@ describe Spree::Core::ProductDuplicator do expect(new_product).to receive(:sku=).with("") expect(new_product).to receive(:product_properties=).with([new_property]) expect(new_product).to receive(:created_at=).with(nil) + expect(new_product).to receive(:price=).with(0) expect(new_product).to receive(:unit_value=).with(nil) expect(new_product).to receive(:updated_at=).with(nil) expect(new_product).to receive(:deleted_at=).with(nil)