isRecalculation example

$this->eventDispatcher->dispatch(new CartLoadedEvent($cart$context));

        return $cart;
    }

    /** * @throws InvalidUuidException */
    public function save(Cart $cart, SalesChannelContext $context): void
    {
        if ($cart->getBehavior()?->isRecalculation()) {
            return;
        }

        $shouldPersist = $this->shouldPersist($cart);

        $event = new CartVerifyPersistEvent($context$cart$shouldPersist);
        $this->eventDispatcher->dispatch($event);

        if (!$event->shouldBePersisted()) {
            $this->delete($cart->getToken()$context);

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