$type =
$element->
getConfig()->
get('article_slider_type', self::TYPE_STATIC_PRODUCT
);
$key = ComponentHandlerInterface::CRITERIA_KEY .
$element->
getId();
switch ($type) { case self::TYPE_PRODUCT_STREAM:
case self::TYPE_NEWCOMER:
case self::TYPE_RANDOM:
case self::TYPE_TOPSELLER:
case self::TYPE_HIGHEST_PRICE:
case self::TYPE_LOWEST_PRICE:
$requestedProducts =
$collection->
getBatchResult()->
get($key);
$element->
getData()->
set('products',
$requestedProducts);
break;
case self::TYPE_STATIC_PRODUCT:
$products =
$element->
getConfig()->
get(self::SELECTED_PRODUCTS, ''
) ?? '';
$productNumbers =
array_filter(explode('|',
$products));
$listProducts =
$collection->
getBatchResult()->
get($key);
$products =
[];
foreach ($productNumbers as $productNumber) { if (!
$listProducts[$productNumber] instanceof ListProduct
) {