/** * {@inheritdoc} */ public function generateCondition(ConditionInterface $condition, QueryBuilder $query, ShopContextInterface $context) { $query->leftJoin('product', 's_articles_avoid_customergroups', 'avoidCustomerGroup', 'avoidCustomerGroup.articleID = product.id AND avoidCustomerGroup.customerGroupId IN (:customerGroupIds)'); /** @var CustomerGroupCondition $condition */ $query->setParameter(':customerGroupIds', $condition->getCustomerGroupIds(), Connection::PARAM_INT_ARRAY); $query->andWhere('avoidCustomerGroup.articleID IS NULL'); }