sGetBasketIds example

/** * @deprecated in 5.6, will be protected in 5.8 * * Get similar shown products to display in ajax add dialog * * @param int $articleID * * @return array<array<string, mixed>> */
    public function getSimilarShown($articleID)
    {
        $productIdsInCart = $this->basket->sGetBasketIds();
        Shopware()->Modules()->Marketing()->sBlacklist = $productIdsInCart ?? [];

        $similarProducts = Shopware()->Modules()->Marketing()->sGetSimilaryShownArticles($articleID);

        $similars = [];
        if (!empty($similarProducts)) {
            foreach ($similarProducts as $similarProduct) {
                $temp = Shopware()->Modules()->Articles()->sGetPromotionById('fix', 0, (int) $similarProduct['id']);
                if (!empty($temp)) {
                    $similars[] = $temp;
                }
            }
Home | Imprint | This part of the site doesn't use cookies.