AfterLineItemQuantityChangedEvent example

/** @var array<mixed> $item */
        foreach ($itemsToUpdate as $item) {
            $this->lineItemFactory->update($cart$item$context);
        }

        $cart->markModified();

        $cart = $this->cartCalculator->calculate($cart$context);
        $this->cartPersister->save($cart$context);

        $this->eventDispatcher->dispatch(new AfterLineItemQuantityChangedEvent($cart$itemsToUpdate$context));
        $this->eventDispatcher->dispatch(new CartChangedEvent($cart$context));

        return new CartResponse($cart);
    }
}
Home | Imprint | This part of the site doesn't use cookies.