Fixed saving termination on new

This commit is contained in:
Frank Schubert
2021-08-03 20:50:52 +02:00
parent 2619183304
commit 33d8e2da0e
3 changed files with 9 additions and 1 deletions

View File

@@ -14,7 +14,12 @@ class Order extends mfBaseModel {
return 0;
}
$p = end($this->getProperty("products"));
$products = $this->getProperty("products");
if(!is_array($products) || !count($products)) {
return 1;
}
$p = end($products);
return ++$p->pos;
}