protected function manageNonPersistentCookie(CartRestoreEvent $cartRestoreEvent, EventDispatcherInterface $dispatcher)
    {
        $cart = $cartRestoreEvent->getCart();

        if (null === $cart) {
            $cart = $this->dispatchNewCart($dispatcher);
        } else {
            $cart = $this->manageCartDuplicationAtCustomerLogin($cart, $dispatcher);
        }

        return $cart;
    }
protected function manageNonPersistentCookie(CartRestoreEvent $cartRestoreEvent, EventDispatcherInterface $dispatcher)
    {
        $cart = $cartRestoreEvent->getCart();

        if (null === $cart) {
            $cart = $this->dispatchNewCart($dispatcher);
        } else {
            $cart = $this->manageCartDuplicationAtCustomerLogin($cart, $dispatcher);
        }

        return $cart;
    }
protected function manageNonPersistentCookie ( CartRestoreEvent $ cartRestoreEvent , EventDispatcherInterface $ dispatcher ) { $ cart = $ cartRestoreEvent -> getCart ( ) ; if ( null === $ cart ) { $ cart = $ this -> dispatchNewCart ( $ dispatcher ) ; } else { $ cart = $ this -> manageCartDuplicationAtCustomerLogin ( $ cart , $ dispatcher ) ; } return $ cart ; }
The cart token is not saved in a cookie, if the cart is present in session, we just change the customer id
if needed or create duplicate the current cart if the customer is not the same as customer already present in
the cart.

@param CartRestoreEvent $cartRestoreEvent
@param EventDispatcherInterface $dispatcher
@return CartModel
@throws \Exception
@throws \Propel\Runtime\Exception\PropelException
The cart token is not saved in a cookie if the cart is present in session we just change the customer id if needed or create duplicate the current cart if the customer is not the same as customer already present in the cart .