addManufacturerTranslation example

->leftJoin('esd', 's_articles_esd_attributes', 'esdAttribute', 'esdAttribute.esdID = esd.id')
            ->leftJoin('manufacturer', 's_media', 'manufacturerMedia', 'manufacturerMedia.path = manufacturer.img')
            ->where('variant.ordernumber IN (:numbers)')
            ->andWhere('variant.active = 1')
            ->andWhere('product.active = 1')
            ->setParameter(':numbers', $numbers, Connection::PARAM_STR_ARRAY);
        if ($this->config->get('hideNoInstock')) {
            $query->andHaving('__product_has_available_variants >= 1');
        }
        $this->fieldHelper->addProductTranslation($query$context);
        $this->fieldHelper->addVariantTranslation($query$context);
        $this->fieldHelper->addManufacturerTranslation($query$context);
        $this->fieldHelper->addUnitTranslation($query$context);
        $this->fieldHelper->addEsdTranslation($query$context);

        return $query;
    }

    private function getPriceCountQuery(string $key): QueryBuilder
    {
        $query = $this->connection->createQueryBuilder();
        if ($this->config->get('calculateCheapestPriceWithMinPurchase')) {
            $query->addSelect('COUNT(DISTINCT ROUND(prices.price * priceVariant.minpurchase, 2)) as priceCount');
        }
$query = $this->connection->createQueryBuilder();

        $query->addSelect($this->fieldHelper->getManufacturerFields());
        $query->addSelect('media.id as __manufacturer_img_id');

        $query->from('s_articles_supplier', 'manufacturer')
            ->leftJoin('manufacturer', 's_articles_supplier_attributes', 'manufacturerAttribute', 'manufacturerAttribute.supplierID = manufacturer.id')
            ->leftJoin('manufacturer', 's_media', 'media', 'media.path = manufacturer.img')
            ->where('manufacturer.id IN (:ids)')
            ->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);

        $this->fieldHelper->addManufacturerTranslation($query$context);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);
        $medias = $this->mediaService->getList(array_column($data, '__manufacturer_img_id')$context);

        $manufacturers = [];
        foreach ($data as $row) {
            $id = $row['__manufacturer_id'];
            $manufacturers[$id] = $this->manufacturerHydrator->hydrate($row);

            if (!empty($row['__manufacturer_img']) && !empty($medias[$row['__manufacturer_img_id']])) {
                $manufacturers[$id]->setCoverMedia($medias[$row['__manufacturer_img_id']]);
            }
Home | Imprint | This part of the site doesn't use cookies.