/** * Applies categorization filter * * @param ProductQueryBuilderInterface $pqb * @param ChannelInterface $channel */ protected function applyCategorizationFilter(ProductQueryBuilderInterface $pqb, ChannelInterface $channel) { switch ($this->categorizationCondition) { case "onlyCategorized": $pqb->addFilter('categories.id', 'IN CHILDREN', [$channel->getCategory()->getId()]); break; case "onlyNonCategorized": $pqb->addFilter('categories.id', 'UNCLASSIFIED', []); break; } }
/** * Apply complete filter * * @param ProductQueryBuilderInterface $pqb * @param ChannelInterface $channel */ protected function applyCompleteFilter(ProductQueryBuilderInterface $pqb, ChannelInterface $channel) { switch ($this->completeCondition) { case "onlyComplete": $pqb->addFilter('completeness_for_export', '=', 100, ['scope' => $channel->getCode()]); break; case "onlyUncomplete": $pqb->addFilter('completeness_for_export', '<', 100, ['scope' => $channel->getCode()]); break; } }