return 'COUNT';
} /**
* This packager builds a bundle for the first x items
* until the maximum number of items in the group is reached.
* If not enough items are found to fill the group, then an empty list will be returned.
*/
public function buildGroupPackage(float
$maxItemsInGroup, LineItemFlatCollection
$sortedItems, SalesChannelContext
$context): LineItemGroup
{ $matchedCount = 0;
$result =
new LineItemGroup();
foreach ($sortedItems as $lineItem) { $quantity =
$lineItem->
getQuantity();
// add the item to our result
// with the current quantity
$result->
addItem($lineItem->
getId(),
$quantity);
$matchedCount +=
$quantity;
// as long as we have not filled our maximum count