getProductTranslation example

/** * Hydrates the data result of the cheapest price query. * This function uses the normally hydrate function of this class * and adds additionally the product unit information to the price. * * @return PriceRule */
    public function hydrateCheapestPrice(array $data)
    {
        $price = $this->hydratePriceRule($data);
        $translation = $this->productHydrator->getProductTranslation($data);
        $data = array_merge($data$translation);

        $unit = $this->unitHydrator->hydrate($data);
        $price->setUnit($unit);

        return $price;
    }

    /** * @param array $data * * @return PriceGroup */
'txtshortdescription' => '__product_description',
            'txtlangbeschreibung' => '__product_description_long',
            'txtshippingtime' => '__variant_shippingtime',
            'txtzusatztxt' => '__variant_additionaltext',
            'txtkeywords' => '__product_keywords',
            'txtpackunit' => '__unit_packunit',
        ]);
    }

    private function assignData(ListProduct $product, array $data): ListProduct
    {
        $translation = $this->getProductTranslation($data);
        $data = array_merge($data$translation);

        $this->assignProductData($product$data);

        $product->setTax(
            $this->taxHydrator->hydrate($data)
        );

        $this->assignPriceGroupData($product$data);

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