createCategoryQuery example

VariantHelperInterface $variantHelper
    ) {
        $this->client = $client;
        $this->provider = $provider;
        $this->queryFactory = $queryFactory;
        $this->variantHelper = $variantHelper;
    }

    public function populate(ShopIndex $index, ProgressHelperInterface $progress)
    {
        $categoryId = $index->getShop()->getCategory()->getId();
        $idQuery = $this->queryFactory->createCategoryQuery($categoryId, 100);
        $progress->start($idQuery->fetchCount(), 'Indexing products');

        while ($ids = $idQuery->fetch()) {
            if (!$this->variantHelper->getVariantFacet()) {
                $query = $this->queryFactory->createProductIdQuery($ids);
                $numbers = $query->fetch();
            } else {
                $numbers = $ids;
            }

            $this->indexProducts($index$numbers);
            
Home | Imprint | This part of the site doesn't use cookies.