return $condition instanceof ImmediateDeliveryCondition;
} /**
* {@inheritdoc}
*/
public function generateCondition( ConditionInterface
$condition,
QueryBuilder
$query,
ShopContextInterface
$context ) { $conditions =
$this->criteria->
getConditionsByClass(VariantCondition::
class);
$conditions =
array_filter($conditions,
function DVariantCondition
$condition) { return $condition->
expandVariants();
});
if (!
$query->
hasState(self::STATE_INCLUDES_IMMEDIATE_DELIVERY_VARIANTS
)) { if (empty($conditions)) { $this->variantHelper->
joinVariants($query);
$query->
andWhere('allVariants.instock >= allVariants.minpurchase'
);
} else { $query->
andWhere('variant.instock >= variant.minpurchase'
);
}