/**
* @param ShopContext|ShopContextInterface $context
*/
public function prepare(PrepareDataCollection
$collection, Element
$element, ShopContextInterface
$context) { $imageType =
$element->
getConfig()->
get('image_type'
);
$key = ComponentHandlerInterface::CRITERIA_KEY .
$element->
getId();
switch ($imageType) { case self::TYPE_IMAGE:
if (!
empty($element->
getConfig()->
get('image'
))) { $collection->
addMediaPaths([$element->
getConfig()->
get('image'
)]);
} break;
case self::TYPE_ARTICLE_OR_BLOG:
$isBlog =
(bool) $element->
getConfig()->
get('blog_category'
);
$categoryId =
(int) $element->
getConfig()->
get('category_selection'
);
if ($isBlog) { break;
}