$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
);
if ($this->shopwareConfig->
get('useLastGraduationForCheapestPrice'
)) { $product->
setListingPrice( $prices[\
count($prices) - 1
] );
} } private function generateCriteria(Element
$element, ShopContextInterface
$context): Criteria
{