CreditNoteOrdersEvent example

$orders->add($order);
                $operation->setReferencedDocumentId($invoice['id']);
                if ($order->getVersionId()) {
                    $operation->setOrderVersionId($order->getVersionId());
                }
            } catch (\Throwable $exception) {
                $result->addError($operation->getOrderId()$exception);
            }
        }

        $this->eventDispatcher->dispatch(new CreditNoteOrdersEvent($orders$context$operations));

        foreach ($orders as $order) {
            $orderId = $order->getId();

            try {
                $operation = $operations[$orderId] ?? null;

                if ($operation === null) {
                    continue;
                }

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