diff --git a/core/lib/spree/core/product_duplicator.rb b/core/lib/spree/core/product_duplicator.rb index f2ba0d9383..882592a359 100644 --- a/core/lib/spree/core/product_duplicator.rb +++ b/core/lib/spree/core/product_duplicator.rb @@ -45,7 +45,7 @@ def duplicate_master new_master.sku = "COPY OF #{master.sku}" new_master.deleted_at = nil new_master.images = master.images.map { |image| duplicate_image image } if @include_images - new_master.price = master.price + new_master.prices = master.prices.map(&:dup) end end diff --git a/core/spec/models/spree/product_duplicator_spec.rb b/core/spec/models/spree/product_duplicator_spec.rb index 7965b556b3..e5720c0642 100644 --- a/core/spec/models/spree/product_duplicator_spec.rb +++ b/core/spec/models/spree/product_duplicator_spec.rb @@ -61,6 +61,10 @@ module Spree expect(new_product.name).to eql "COPY OF #{product.name}" end + it "will set the same price" do + expect(new_product.reload.price).to eql product.price + end + it "will set an unique sku" do expect(new_product.sku).to include "COPY OF SKU" end