2

I want to create a new order from an existing order (customer address, cart products...etc) with a button "copy", Is it possible ?

Edit :

1) Imagine you have :

Order n°10001 Customer name : Magento, email : magento@magento.fr ...etc Customer products : computer ASUS , speakers...

Now you want to have exactly the same order with the same customer and the same products BUT with a different n° of order :

Order n°10002 Customer name : Magento, email : magento@magento.fr ...etc Customer products : computer ASUS , speakers...

So, first question : Is it possible ?

2) If yes, how can i do this ? i just don't know how to begin to do this in fact...

1

That's already a built in feature. The button is called "reorder" and you will find it next to each order in the customer account

|improve this answer|||||
  • A working week for this... that's my first magento project, i feel so stupid right now... but thank you a lot, you save me :) – potassium Jul 29 '15 at 9:47
  • But it doesn't copy the status? – Fabian Blechschmidt Jul 30 '15 at 10:46
  • No, should it? The title states "new order". Otherwise I agree that it sounds like a broken process. – Fabian Schmengler Jul 30 '15 at 11:05
1

Check the code in the backend for editing orders. When you edit an order, magento cancels the old one and creates a new one.

  1. Create quote from order
  2. Create order from quote
|improve this answer|||||
  • Thank you, it seems to be what i needed but it's very complicated to just "copy" an order in the backoffice... + my customer wants to create an order from an order with "complete" status. I think it's just impossible ? – potassium Jul 27 '15 at 12:18
  • Sounds like a broken process. What do you want to achieve? – Fabian Blechschmidt Jul 27 '15 at 13:04
  • I agree with you. My customer has some strange requests... He wants to create a new order which would be a copy of a "complete" order and then he could update the cart products or change address ... Edit : I change "complete" to "processing" in database for an order and something happened but there were some troubles (the products disappear...) – potassium Jul 27 '15 at 13:28
0

I found a very good example which create a quote and convert it to an order. It could help some of you : https://sohelrana09.wordpress.com/2011/09/15/trouble-creating-a-quoteorder-through-custom-code-programmatically-create-order-without-use-api/#comment-451

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.