fetchOrderLineItemsForOrder example

return;
        }

        if ($event->getEntityName() !== 'order') {
            return;
        }

        if ($event->getFromPlace()->getTechnicalName() === OrderStates::STATE_CANCELLED) {
            $this->stockStorage->alter(
                array_map(
                    fn (array $item) => $this->changeset($item['id']$item['product_id'], 0, (int) $item['quantity']),
                    $this->fetchOrderLineItemsForOrder($event->getEntityId())
                ),
                $event->getContext()
            );

            return;
        }

        if ($event->getToPlace()->getTechnicalName() === OrderStates::STATE_CANCELLED) {
            $this->stockStorage->alter(
                array_map(
                    fn (array $item) => $this->changeset($item['id']$item['product_id'](int) $item['quantity'], 0),
                    
Home | Imprint | This part of the site doesn't use cookies.