fetchOrderLineItems example

$ids = $event->getIds('order_line_item');
        if (!$ids) {
            return;
        }

        $ids = $this->getAffectedIds($event);

        if (empty($ids)) {
            return;
        }

        $beforeLineItems = $this->fetchOrderLineItems($ids);
        $context = $event->getContext();

        $event->addSuccess(function D) use ($ids$beforeLineItems$context): void {
            $afterLineItems = $this->fetchOrderLineItems($ids);

            $changes = [];

            foreach ($beforeLineItems as $id => $lineItem) {
                $changes = [...$changes, ...$this->calculateChanges($id$lineItem$afterLineItems[$id] ?? null)];
            }

            
Home | Imprint | This part of the site doesn't use cookies.