src/cart/storage/CartStorageFactory.php
public static function forUser(User $user)
    {
        if ($user->getIsGuest()) {
            return Yii::$app->session;
        }

        return Yii::createObject(['class' => RemoteCartStorage::class, 'sessionCartId' => 'yz\shoppingcart\ShoppingCart']);
    }
public static function forUser(User $user)
    {
        if ($user->getIsGuest()) {
            return Yii::$app->session;
        }

        return Yii::createObject(['class' => RemoteCartStorage::class, 'sessionCartId' => 'yz\shoppingcart\ShoppingCart']);
    }
public static function forUser ( User $ user ) { if ( $ user -> getIsGuest ( ) ) { return Yii :: $ app -> session ; } return Yii :: createObject ( [ 'class' => RemoteCartStorage :: class , 'sessionCartId' => 'yz\shoppingcart\ShoppingCart' ] ) ; }
CartStorageFactory constructor.

@param User $user
@return \yii\web\Session
CartStorageFactory constructor .