protected function loadCartFromSession()
    {
        $cartIdInSession = $this
            ->cartSessionManager
            ->get();

        if (!$cartIdInSession) {
            return null;
        }

        $cart = $this
            ->cartRepository
            ->findOneBy([
                'id' => $cartIdInSession,
                'ordered' => false,
            ]);

        return ($cart instanceof CartInterface)
            ? $cart
            : null;
    }
protected function loadCartFromSession()
    {
        $cartIdInSession = $this
            ->cartSessionManager
            ->get();

        if (!$cartIdInSession) {
            return null;
        }

        $cart = $this
            ->cartRepository
            ->findOneBy([
                'id' => $cartIdInSession,
                'ordered' => false,
            ]);

        return ($cart instanceof CartInterface)
            ? $cart
            : null;
    }
protected function loadCartFromSession ( ) { $ cartIdInSession = $ this -> cartSessionManager -> get ( ) ; if ( ! $ cartIdInSession ) { return null ; } $ cart = $ this -> cartRepository -> findOneBy ( [ 'id' => $ cartIdInSession , 'ordered' => false , ] ) ; return ( $ cart instanceof CartInterface ) ? $ cart : null ; }
Get cart from session.

@return CartInterface|null Cart loaded from session
Get cart from session .