$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;
} $lineItem->
setDataTimestamp(new \
DateTimeImmutable());
$lineItem->
setDataContextHash($hash);
} } foreach ($lineItems as $match) { // enrich all products in original cart
$this->
enrich($context,
$match['item'
],
$data,
$behavior);
// remove "parent" products which should never be displayed in storefront
$this->
validateParents($match['item'
],
$data,
$match['scope'
]);
// validate data timestamps that inactive products (or not assigned to sales channel) are removed