When you get an order in Magento and the calls you to add an extra item to the order, you need to change the order, but Magento creates a new ordernumber for this order.

For example the order number was #1000001 and after the admin changes the order the new order number is #1000001-1. This is not really consistent and when exporting the orders I'm not able to read this because of our connection with the accountancy software.

Is it possible for magento to increment the order by the latest available order number? So in this particular case after editing the order, the order number changes to #1000002 of even better, the order number keeps #1000001.


You cannot have keep the same order number because it has to be unique.
but you can change it to the next available order.
The -1 is added in Mage_Adminhtml_Model_Sales_Order_Create::createOrder() at the line

'increment_id'              => $originalId.'-'.($oldOrder->getEditIncrement()+1)

You can replace this with

'increment_id'              => Mage::getSingleton('eav/config')->getEntityType(Mage_Sales_Model_Order::ENTITY)->fetchNewIncrementId($oldOrder->getStoreId())

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.