$items =
array_column($lineItems, 'item'
);
// find products in original cart which requires data from gateway
$ids =
$this->
getNotCompleted($data,
$items,
$context);
if (!
empty($ids)) { // fetch missing data over gateway
$products =
$this->productGateway->
get($ids,
$context);
// add products to data collection
foreach ($products as $product) { $data->
set($this->
getDataKey($product->
getId()),
$product);
} $hash =
$this->generator->
getSalesChannelContextHash($context,
[RuleAreas::PRODUCT_AREA
]);
// refresh data timestamp to prevent unnecessary gateway calls
foreach ($items as $lineItem) { if (!\
in_array($lineItem->
getReferencedId(),
$products->
getIds(), true
)) { $lineItem->
setDataTimestamp(null
);
continue;
}