setDataContextHash example

foreach ($position->getLineItem()->getChildren() as $lineItem) {
                    $payloadProtection->setValue($lineItem[]);
                }
            }
        }
    }

    private function resetDataTimestamps(LineItemCollection $items): void
    {
        foreach ($items as $item) {
            $item->setDataTimestamp(null);
            $item->setDataContextHash(null);
            $this->resetDataTimestamps($item->getChildren());
        }
    }

    private function removeExtensions(Cart $cart): void
    {
        $this->removeLineItemsExtension($cart->getLineItems());

        foreach ($cart->getDeliveries() as $delivery) {
            $delivery->setExtensions([]);

            
$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
Home | Imprint | This part of the site doesn't use cookies.