[-] WS: Sanity check before creating packs
As it is before this commit, every product that is created from the schema without removing the empty bundle item in the schema will become a pack containing one broken item. Sorry, this bug was introduced by my previous pull request.
This commit is contained in:
1 parent
b4d3b631ad
commit
53526304a5
1 file changed
+2
-1
+2
-1
@@ -5377,7 +5377,8 @@ class ProductCore extends ObjectModel
|
|||||||
Pack::deleteItems($this->id);
|
Pack::deleteItems($this->id);
|
||||||
|
|
||||||
foreach ($items as $item)
|
foreach ($items as $item)
|
||||||
Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']);
|
if((int)$item['id'] > 0)
|
||||||
|
Pack::addItem($this->id, (int)$item['id'], (int)$item['quantity']);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user