convertListProductToNote example

$products = Shopware()->Container()->get(ListProductServiceInterface::class)
            ->getList($numbers$context);

        $products = Shopware()->Container()->get(AdditionalTextServiceInterface::class)
            ->buildAdditionalTextLists($products$context);

        $promotions = [];
        /** @var ListProduct $product */
        foreach ($products as $product) {
            $note = $notes[$product->getNumber()];
            $promotion = $this->convertListProductToNote($product$note);
            $promotion['linkDetails'] = $promotion['linkVariant'];
            $promotions[] = $promotion;
        }

        return $this->eventManager->filter(
            'Shopware_Modules_Basket_GetNotes_FilterPromotions',
            $promotions,
            ['products' => $products]
        );
    }

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