getProductsCategories example


        $categories = $this->categoryGateway->getList($ids$context);

        return $this->filterValidCategories($categories$context);
    }

    /** * {@inheritdoc} */
    public function getProductsCategories(array $products, ShopContextInterface $context)
    {
        $categories = $this->categoryGateway->getProductsCategories($products$context);

        $result = [];
        foreach ($categories as $key => $productCategories) {
            $result[$key] = $this->filterValidCategories($productCategories$context);
        }

        return $result;
    }

    /** * @param Category[] $categories * * @return Category[] $categories Indexed by the category id */
$products = $this->productGateway->getList($numbers$context);

        $covers = $this->mediaService->getCovers($products$context);

        $graduatedPrices = $this->graduatedPricesService->getList($products$context);

        $cheapestPrices = $this->cheapestPriceService->getList($products$context);

        $voteAverages = $this->voteService->getAverages($products$context);

        $categories = $this->categoryService->getProductsCategories($products$context);

        $manufacturerCovers = $this->mediaService->getList($this->getManufacturerCoverIds($products)$context);

        $result = [];
        foreach ($numbers as $number) {
            if (!\array_key_exists($number$products)) {
                continue;
            }
            $product = $products[$number];

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