title: Import quote and Add product to cart in Magento 2
body: <p>Creating an external script to import Quotes/Cart (other CMS). My code able to add quote but not creating cart. Need all quoted items to show when user login to their account. I have enabled persistent cart also.</p>
  
  <pre><code>   class QuoteMove extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface 
  
  
    public function __construct(
      \Magento\Framework\ObjectManagerInterface $objectManager,
      \Magento\Framework\Event\Manager $eventManager,
      \Magento\Framework\App\AreaList $areaList,
      \Magento\Framework\App\Request\Http $request,
      \Magento\Framework\App\Response\Http $response,
      \Magento\Framework\ObjectManager\ConfigLoaderInterface $config,
      \Magento\Framework\App\State $state,
      \Magento\Framework\Filesystem $fileSystem,
      \Magento\Framework\Registry $registry,
      \Magento\Store\Model\Store $store,
      \Psr\Log\LoggerInterface $logger,
      \Magento\Framework\File\Csv $csvProcessor,
      \Magento\Quote\Model\QuoteFactory $quote,
      \Magento\Catalog\Model\Product $product
  )
  
  
                  $quotes = []; 
                  $email = email@domain.com;
                  $qty = xxx ;
                  $customerId  = xxx ;
  
                  $this-&gt;customer = $this-&gt;getCustomerByEmail($email);
                      $customerId = $this-&gt;customer-&gt;getId();
  
                      $quote = $this-&gt;quotes[$customerId];
                      $quote-&gt;setCustomerNote(_NOTES_);
                      $quote-&gt;setCouponCode(_COUPON_CODE_);
  
                      $product = $this-&gt;_product-&gt;load('PRODUCT_ID');  //PRODUCT_ID= xx
                      $params = [];
                      $params['product'] = $productId;
                      $params['qty'] = intval($qty);
                      $options = [];
                      $options[_ATTRIBUTE_] = _VALUE_]   ;
                      $params['super_attribute'] = $options;
  
                      $config = new \Magento\Framework\DataObject();
                      $config-&gt;setItem($params);
                      $quote-&gt;addProduct($product,$config);
                      $quote-&gt;save();      
  
                  How to Save items in cart now ??
  </code></pre>
  
  <p>So when user login into account able to view items in cart.</p>