get(StoreManagerInterface::class); /** @var CartInterface $quote */ $quote = $objectManager->get(CartInterface::class); $quote->setStoreId($storeManager->getStore()->getId()) ->setCustomerIsGuest(false) ->setCustomerId($customer->getId()); /** @var CartRepositoryInterface $quoteRepository */ $quoteRepository = $objectManager->get(CartRepositoryInterface::class); $quoteRepository->save($quote);