Skip to content

Commit

Permalink
Merge pull request opencart#14268 from stalker780/patch-5
Browse files Browse the repository at this point in the history
Update product.php
  • Loading branch information
danielkerr authored Dec 12, 2024
2 parents 5a4d38d + f258f39 commit 4c8289a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions upload/admin/model/catalog/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,11 @@ public function editProduct(int $product_id, array $data): void {
*
* @return void
*/
public function copyProduct(int $product_id): void {
public function copyProduct(int $product_id): int {
$product_info = $this->model_catalog_product->getProduct($product_id);

$new_product_id = 0;

if ($product_info) {
$product_data = $product_info;

Expand All @@ -322,8 +324,10 @@ public function copyProduct(int $product_id): void {
$product_data['product_reward'] = $this->model_catalog_product->getRewards($product_id);
$product_data['product_store'] = $this->model_catalog_product->getStores($product_id);

$this->model_catalog_product->addProduct($product_data);
$new_product_id = $this->model_catalog_product->addProduct($product_data);
}

return $new_product_id;
}

/**
Expand Down

0 comments on commit 4c8289a

Please sign in to comment.