I want to know how to create orders programmatically without passing through the payment step.

I know it's possible, using helper (or model, but I can't find the link):


But I don't know how to use it. And some methods are deprecated, can anyone help me?

To sum up: I want to create and order and in the same time, add card product when I click on by "confirm my order".

If possible without overriding Magento_Checkout

EDIT : to sum up 2 : I want my customer to add product to his cart. Then, when he goes on "checkout", my custom page is displaying with some info (such as addresses...). Then when he clicks on "validate", his commande is created in magento but he doesn't had to go to the payment step. The order is created only for information (in magento), because the "real" order will be manage by an API.

| improve this question | | | | |
  • you should provide some more info about how you want to do it. What does it mean 'without payment step'? you don't need payment? where do you want to create these orders: from the frontend or from the backend or from command line? In any of the case, no need to override Magento_Checkout module, just write down your own module, with the pieces you need. And you should also provide some of the efforts you've made by yourself before asking, and posting a tutorial is not an effort. – sissy Jul 4 '18 at 13:56
  • See the updated answer – Morgan Tartreau Jul 4 '18 at 14:09
  • ok, bit better now. To avoid the payment step have you considered an extension for the 'one step checkout'? With that you should only adjust the payment section to collect the info you want and that's it. Otherwise with the code of the module you have found, you have to create a controller that is called in your custom checkout page, that creates the order exactly like in the tutorial you linked. – sissy Jul 4 '18 at 14:15
  • Yes, I considered using an extension. But when I'm looking for it, the "one step checkout" result is that shipping and payment are on the same page (but I don't want to have the payment step). The tutorial is well done, but it's using some deprecated method, and I want to avoid that... – Morgan Tartreau Jul 4 '18 at 14:24
  • I understood that you so not want the payment step, but once you have the extension, it is easier to customize it than doing it completely... you could just hide the payment box and pass some dummy data... – sissy Jul 4 '18 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.