Skip to content

Commit d2a7a8d

Browse files
committed
Fix for #913
1 parent eb89b25 commit d2a7a8d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/CommunityStore/Product/ProductList.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,14 @@ public function finalizeQuery(\Doctrine\DBAL\Query\QueryBuilder $query)
425425
}
426426
if (!$this->showOutOfStock) {
427427
$query->andWhere("pQty > 0 OR pQtyUnlim = 1");
428+
429+
$query->andWhere($query->expr()->or('pDateAvailableStart IS NULL',
430+
$query->expr()->lte('pDateAvailableStart', $query->createNamedParameter(date('Y-m-d H:i:s')))));
431+
432+
$query->andWhere($query->expr()->or('pDateAvailableEnd IS NULL',
433+
$query->expr()->gte('pDateAvailableEnd', $query->createNamedParameter(date('Y-m-d H:i:s')))));
428434
}
435+
429436
if ($this->activeOnly) {
430437
$query->andWhere("pActive = 1");
431438
}

0 commit comments

Comments
 (0)