/**
* {@inheritdoc}
*/
public function handle(ResolvedDataCollection
$collection, Element
$element, ShopContextInterface
$context) { $key = ComponentHandlerInterface::CRITERIA_KEY .
$element->
getId();
$type =
$element->
getConfig()->
get('article_type'
);
$product =
current($collection->
getBatchResult()->
get($key));
if ($product &&
$type === self::TYPE_STATIC_VARIANT
) { $product =
$this->additionalTextService->
buildAdditionalText($product,
$context);
$this->
switchPrice($product);
} $element->
getData()->
set('product',
$product);
} private function switchPrice(ListProduct
$product): void
{ $prices =
array_values($product->
getPrices());
$product->
setListingPrice($prices[0
]);
$product->
setDisplayFromPrice(\
count($product->
getPrices()) > 1
);