Use new function fetchAllByFkProductChild
This commit is contained in:
parent
3d926ff3a1
commit
3a232796d8
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user