setRelatedProducts example

$media = $this->mediaService->getProductsMedia($listProducts$context);

        $properties = $this->propertyService->getList($listProducts$context);

        $configuration = $this->configuratorService->getProductsConfigurations($listProducts$context);

        $products = [];
        foreach ($listProducts as $number => $listProduct) {
            $product = Product::createFromListProduct($listProduct);

            if (isset($relatedProducts[$number])) {
                $product->setRelatedProducts($relatedProducts[$number]);
            }

            if (isset($relatedProductStreams[$number])) {
                $product->setRelatedProductStreams($relatedProductStreams[$number]);
            }

            if (isset($similarProducts[$number])) {
                $product->setSimilarProducts($similarProducts[$number]);
            }

            if (isset($votes[$number])) {
                
Home | Imprint | This part of the site doesn't use cookies.