File tree 2 files changed +6
-4
lines changed 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ public function copy(Product $product)
78
78
$ productData = $ this ->removeStockItem ($ productData );
79
79
$ duplicate ->setData ($ productData );
80
80
$ duplicate ->setOptions ([]);
81
+ $ duplicate ->setMetaTitle (null );
82
+ $ duplicate ->setMetaKeyword (null );
83
+ $ duplicate ->setMetaDescription (null );
81
84
$ duplicate ->setIsDuplicate (true );
82
85
$ duplicate ->setOriginalLinkId ($ product ->getData ($ metadata ->getLinkField ()));
83
86
$ duplicate ->setStatus (\Magento \Catalog \Model \Product \Attribute \Source \Status::STATUS_DISABLED );
@@ -89,10 +92,6 @@ public function copy(Product $product)
89
92
$ this ->setDefaultUrl ($ product , $ duplicate );
90
93
$ this ->setStoresUrl ($ product , $ duplicate );
91
94
$ this ->getOptionRepository ()->duplicate ($ product , $ duplicate );
92
- $ product ->getResource ()->duplicate (
93
- $ product ->getData ($ metadata ->getLinkField ()),
94
- $ duplicate ->getData ($ metadata ->getLinkField ())
95
- );
96
95
return $ duplicate ;
97
96
}
98
97
Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ public function testCopy()
197
197
$ duplicateMock ->expects ($ this ->once ())->method ('setCreatedAt ' )->with (null );
198
198
$ duplicateMock ->expects ($ this ->once ())->method ('setUpdatedAt ' )->with (null );
199
199
$ duplicateMock ->expects ($ this ->once ())->method ('setId ' )->with (null );
200
+ $ duplicateMock ->expects ($ this ->once ())->method ('setMetaTitle ' )->with (null );
201
+ $ duplicateMock ->expects ($ this ->once ())->method ('setMetaKeyword ' )->with (null );
202
+ $ duplicateMock ->expects ($ this ->once ())->method ('setMetaDescription ' )->with (null );
200
203
$ duplicateMock ->expects ($ this ->atLeastOnce ())->method ('getStoreIds ' )->willReturn ([]);
201
204
$ duplicateMock ->expects ($ this ->atLeastOnce ())->method ('setData ' )->willReturn ($ duplicateMock );
202
205
$ this ->copyConstructorMock ->expects ($ this ->once ())->method ('build ' )->with ($ this ->productMock , $ duplicateMock );
You can’t perform that action at this time.
0 commit comments