sGetTranslation example

trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED);

        $id = (int) $id;
        $categoryId = (int) $this->frontController->Request()->getQuery('sCategory');

        $supplier = Shopware()->Models()->getRepository(Supplier::class)->find($id);
        if (!($supplier instanceof Supplier)) {
            return [];
        }
        $supplier = Shopware()->Models()->toArray($supplier);
        if (!Shopware()->Shop()->getDefault()) {
            $supplier = $this->sGetTranslation($supplier$supplier['id'], 'supplier');
        }
        $supplier['link'] = $this->config['sBASEFILE'];
        $supplier['link'] .= '?sViewport=cat&sCategory=' . $categoryId . '&sPage=1&sSupplier=0';

        return $supplier;
    }

    /** * Product price calculation * * @param float $price * @param float $tax * @param int $taxId * @param array $article product data as an array * * @throws Enlight_Exception * * @return string $price formatted price */
'articleId' => $productId]
        );

        foreach ($variantsData as $variantData) {
            $product = new ListProduct(
                $productId,
                $variantData['id'],
                $variantData['ordernumber']
            );

            if ($variantData['id'] == $mainVariantId) {
                $variantData = $this->productModule->sGetTranslation(
                    $variantData,
                    $productId,
                    'article'
                );
            } else {
                $variantData = $this->productModule->sGetTranslation(
                    $variantData,
                    $variantData['id'],
                    'variant'
                );
            }

            
        $checkForProduct = $this->db->fetchAll(
            'SELECT * FROM s_order_comparisons WHERE sessionID=?',
            [$this->session->offsetGet('sessionId')]
        );

        if (!\count($checkForProduct)) {
            return [];
        }

        foreach ($checkForProduct as $k => $product) {
            $checkForProduct[$k]['articlename'] = stripslashes($product['articlename']);
            $checkForProduct[$k] = $this->articleModule->sGetTranslation($product$product['articleID'], 'article');
            if (!empty($checkForProduct[$k]['articleName'])) {
                $checkForProduct[$k]['articlename'] = $checkForProduct[$k]['articleName'];
            }

            $checkForProduct[$k]['articleId'] = $product['articleID'];
        }

        return $checkForProduct;
    }

    /** * Get all products and a table of their properties as an array * * @return array Associative array with all products or empty array */
$addPremium,
                $sBasketAmount,
            ]
        );

        if (!$premium) {
            return false;
        }

        // Load translations for product or variant         if ($premium['main_detail_id'] !== $premium['variantID']) {
            $premium = $this->moduleManager->Articles()->sGetTranslation(
                $premium,
                $premium['variantID'],
                'variant'
            );
        } else {
            $premium = $this->moduleManager->Articles()->sGetTranslation(
                $premium,
                $premium['articleID'],
                'article'
            );
        }

        
Home | Imprint | This part of the site doesn't use cookies.