sGetArticlePictures example


    public function getArticleListingCover($articleId$forceMainImage = false)
    {
        trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use the sArticles::sGetArticlePictures instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED);

        return $this->sGetArticlePictures($articleId, true, 0, null, false, false, $forceMainImage);
    }

    /** * Get all pictures from a certain product * * @param int $sArticleID * @param bool $onlyCover * @param int $pictureSize | unused variable * @param string $ordernumber * @param bool $allImages | unused variable * @param bool $realtime | unused variable * @param bool $forceMainImage | will return the main image no matter which variant restriction is set * * @return array */

    public function sGetArticleImageLinks($articleId$orderNumber$imageSize = null, $separator = '|')
    {
        $imageSize = ($imageSize === null) ? 'original' : $imageSize;
        $returnData = [];
        if (empty($articleId) || empty($orderNumber)) {
            return '';
        }
        $imageData = Shopware()->Modules()->Articles()->sGetArticlePictures($articleId, false, null, $orderNumber);
        $cover = Shopware()->Modules()->Articles()->sGetArticlePictures($articleId, true, null, $orderNumber);
        $returnData[] = $cover['src'][$imageSize];
        foreach ($imageData as $image) {
            $returnData[] = $image['src'][$imageSize];
        }

        return implode($separator$returnData);
    }

    /** * Returns an array with the product property data. * Needs to be parsed over the feed smarty template * * @param int $articleId * @param int $filterGroupId * * @return array */
->sFormatPrice($getProducts[$key]['amountnet']);

            if (!empty($getProducts[$key]['purchaseunitTemp'])) {
                $getProducts[$key]['purchaseunit'] = $getProducts[$key]['purchaseunitTemp'];
                $getProducts[$key]['itemInfo'] = $getProducts[$key]['purchaseunit'] . " {$getUnitData['description']} / " . $this->moduleManager->Articles()->sFormatPrice(str_replace(',', '.', $getProducts[$key]['amount']) / $quantity);
            }

            if (!empty($getProducts[$key]['additional_details']['image'])) {
                $getProducts[$key]['image'] = $this->getBasketImage($getProducts[$key]['additional_details']['image']);
            } elseif ((int) $getProducts[$key]['modus'] === CartPositionsMode::PREMIUM_PRODUCT && !empty($getProducts[$key]['articleID'])) {
                $getProducts[$key]['image'] = $this->moduleManager->Articles()
                    ->sGetArticlePictures(
                        $getProducts[$key]['articleID'],
                        true,
                        $this->config->get('sTHUMBBASKET'),
                        $getProducts[$key]['ordernumber']
                    );
            }

            // Links to details, basket             $getProducts[$key]['linkDetails'] = $this->config->get('sBASEFILE') . '?sViewport=detail&sArticle=' . $getProducts[$key]['articleID'];
            if ($getProducts[$key]['modus'] == CartPositionsMode::VOUCHER) {
                $getProducts[$key]['linkDelete'] = $this->config->get('sBASEFILE') . '?sViewport=basket&sDelete=voucher';
            }
Home | Imprint | This part of the site doesn't use cookies.