add to cart links for products in home

This commit is contained in:
2021-06-09 13:06:52 +02:00
parent d9d2180f94
commit 352223500f
25 changed files with 561 additions and 249 deletions

View File

@@ -45,9 +45,11 @@ class ComputedMaterialsReferences extends EntityReferenceFieldItemList
->sort('created', 'DESC')
->range(0,200);
$results = $query->execute();
$nids = array_rand($results, 70);
foreach ($nids as $key => $nid) {
$this->list[$key] = $this->createItem($key, $nid);
if ($results) {
$nids = array_rand($results, 70);
foreach ($nids as $key => $nid) {
$this->list[$key] = $this->createItem($key, $nid);
}
}
}