prepareListing example


        $body = [
            'totalCount' => $result->getTotalCount(),
        ];

        if ($this->Request()->getParam('loadFacets')) {
            $body['facets'] = array_values($result->getFacets());
            $body['listing'] = false;
            $body['pagination'] = false;
        }
        if ($this->Request()->getParam('loadProducts')) {
            $this->prepareListing($result);
            $body['listing'] = true;
            $this->preparePagination($result);
            $body['pagination'] = true;
        }
        $this->View()->assign($body);

        $this->Response()->headers->set('Shopware-Listing-Total', (string) $result->getTotalCount());
    }

    private function fetchStreamListing(int $categoryId, int $productStreamId): ProductSearchResult
    {
        
Home | Imprint | This part of the site doesn't use cookies.