Use new function fetchAllByFkProductChild

This commit is contained in:
Cédric 2020-09-04 11:43:56 +02:00 committed by GitHub
parent 3d926ff3a1
commit 3a232796d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1194,9 +1194,13 @@ class Product extends CommonObject
}
//We also check if it is a child product
if (!$error && ($prodcomb->fetchByFkProductChild($this->id) > 0) && ($prodcomb->delete($user) < 0)) {
$error++;
$this->errors[] = 'Error deleting child combination';
if (!$error) {
foreach ($prodcomb->fetchAllByFkProductChild($this->id) as $obj) {
if ($obj->delete($user) < 0) {
$error++;
$this->errors[] = 'Error deleting child combination';
}
}
}
}