setSearchResultResponse example

/** * Loads the listing count for the provided listing parameters. * Sets a json response with: `facets`, `totalCount` and `products`. * * @return void */
    public function listingCountAction()
    {
        $searchTerm = $this->Request()->getParam('sSearch');
        if ($searchTerm !== null) {
            $result = $this->fetchSearchListing();
            $this->setSearchResultResponse($result);

            return;
        }

        $categoryId = (int) $this->Request()->getParam('sCategory');

        $context = $this->container->get(ContextServiceInterface::class)->getShopContext();

        $category = $this->container->get(CategoryGateway::class)->get($categoryId$context);
        if ($category instanceof Category) {
            $productStream = $category->getProductStream();

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