How to add a product to cart, like a guest customer, without the need to have a registered product?

I created a module that have some informations about products that will be added to the shopping cart by api:

  "products" : [
      "name" : "product1",
      "price" : 30.20,
      "qty" : 1
      "name" : "product2",
      "price" : 20.30,
      "qty" : 2

But this products is not registered in Magento database. And I don't have the interest to register it. I only need to use the informations about these products to finish the checkout.

I need to know if someone knows how to add a "not registered" product to cart to magento make the collection with this "mocked" product and not search a product in the database.

  • Please check the link it may help you click here Aug 20, 2018 at 6:55
  • @CharulTyagi This link don't help me, because to add the product to cart it need to exists (registered in database). I need to add a product not registered and I don't want to register the product. This is the same as what happens with the guest customer. But for product. Aug 20, 2018 at 16:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.