resetFacets example

$criteria = $this->createCategoryStreamCriteria($categoryId$streamId$context);
        } else {
            $criteria = $this->storeFrontCriteriaFactory
                ->createListingCriteria($this->Request()$context);
        }

        // Creating the criteria above will also set the sPage param to at least 1, which we don't want         $this->Request()->setParam('sPage', null);

        // Performance increase         $criteria->setFetchCount(false);
        $criteria->resetFacets();
        $criteria->limit(1);

        $numberResult = $this->productNumberSearch->search($criteria$context);

        return $numberResult->getTotalCount() > 0;
    }

    /** * @param array<string, mixed> $categoryContent */
    private function getRedirectLocation(array $categoryContent, bool $hasEmotion, ShopContextInterface $context): ?string
    {

        }

        $facetFilter = $this->container->get('shopware_product_stream.facet_filter');
        $facetFilter->add($criteria);

        $criteria->setGeneratePartialFacets(
            $this->container->get(Shopware_Components_Config::class)->get('listingMode') === 'filter_ajax_reload'
        );

        if (!$this->Request()->get('loadFacets')) {
            $criteria->resetFacets();
        }

        $search = $this->container->get(ProductSearchInterface::class);

        if (!$this->Request()->getParam('loadProducts')) {
            $criteria->limit(1);
        }

        $result = $search->search($criteria$context);

        if (!$this->Request()->get('loadFacets')) {
            
$this->criteriaFactory = $criteriaFactory;
    }

    /** * @return Criteria */
    public function createCriteria(Request $request, ShopContextInterface $context)
    {
        $criteria = $this->criteriaFactory->createListingCriteria($request$context);

        $criteria->removeBaseCondition('category');
        $criteria->resetFacets();

        $category = $context->getShop()->getCategory()->getId();
        $criteria->addBaseCondition(new CategoryCondition([$category]));

        return $criteria;
    }
}

        $criteria = $this->getSearchCriteria($request$context);

        $criteria->limit($this->config->get('MaxLiveSearchResults', 6));

        $this->eventManager->notify('Shopware_SearchBundle_Create_Ajax_Search_Criteria', [
            'criteria' => $criteria,
            'request' => $request,
            'context' => $context,
        ]);

        $criteria->resetFacets();

        return $criteria;
    }

    /** * @return Criteria */
    public function createAjaxListingCriteria(Request $request, ShopContextInterface $context)
    {
        $criteria = $this->createCriteriaFromRequest($request$context);

        
Home | Imprint | This part of the site doesn't use cookies.