rewriteLinks example



        if ($this->container->get('config')->get('useShortDescriptionInListing')) {
            foreach ($products as &$product) {
                if (\strlen($product['description']) > 5) {
                    $product['description_long'] = $product['description'];
                }
            }
            unset($product);
        }

        return $this->container->get(ListingLinkRewriteServiceInterface::class)->rewriteLinks(
            $result->getCriteria(),
            $products,
            $result->getContext(),
            $categoryId
        );
    }

    private function loadThemeConfig(): void
    {
        $shop = $this->container->get('shop');
        if (!$shop instanceof Shop) {
            
$product = $this->legacyStructConverter->convertListProductStruct($productStruct);

            if (!empty($categoryId) && $categoryId != $context->getShop()->getCategory()->getId()) {
                $product['linkDetails'] .= "&sCategory=$categoryId";
            }

            $product['description_long'] = $this->sOptimizeText($product['description_long']);

            $products[(string) $product['ordernumber']] = $product;
        }

        $products = $this->listingLinkRewriteService->rewriteLinks($criteria$products$context);

        $pageSizes = explode('|', $this->config->get('numberArticlesToShow'));
        $pageSizes = array_map('\intval', $pageSizes);
        $sPage = (int) $request->getParam('sPage', 1);

        return [
            'sArticles' => $products,
            'criteria' => $criteria,
            'facets' => $searchResult->getFacets(),
            'sPage' => $sPage,
            'pageIndex' => $sPage,
            
Home | Imprint | This part of the site doesn't use cookies.