diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 2afa8ccb5..be532d14e 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -662,7 +662,10 @@ class ProductRepository extends Repository if (! in_array('categories', $attributesToSkip)) { foreach ($originalProduct->categories as $category) { - $copiedProduct->categories()->save($category->replicate()); + DB::table('product_categories')->insert([ + 'product_id' => $copiedProduct->id, + 'category_id' => $category->id, + ]); } }