// request multiple products by criteria
$collection->
getBatchRequest()->
setCriteria($key,
$criteria);
break;
case self::TYPE_STATIC_PRODUCT:
$products =
$element->
getConfig()->
get(self::SELECTED_PRODUCTS, ''
) ?? '';
$productNumbers =
array_filter(explode('|',
$products));
if (empty($productNumbers)) { $productNumbers =
[];
} $collection->
getBatchRequest()->
setProductNumbers($key,
$productNumbers);
break;
case self::TYPE_STATIC_VARIANT:
$productVariants =
$element->
getConfig()->
get(self::SELECTED_VARIANTS, ''
) ?? '';
$productNumbers =
array_filter(explode('|',
$productVariants));
if (empty($productNumbers)) { $productNumbers =
[];
} $collection->
getBatchRequest()->
setProductNumbers($key,
$productNumbers);
break;
} }