When using opencart you must have come across an issue with out of stock error on order edit on the backend. You may not have come across this issue if you don’t use the backend order entry system.

So what is the out of stock error on order edit about?
Well, suppose you have a single quantity of the product left. And the customer places an order for it. All goes well. You receive an order. No problem till now.
Let’s call this product as Product A. Note the quantity was 1 earlier but after order it became 0.
Now customers call you up or send an email or communicate via other means and he wants to change the shipping address. You say “Ok, We will change it for you.”
You go into the edit section of the order. In step no 2, when opencart checks the product stock of Product A. It is ZERO. So it gives you an error that “Products you are trying to add is out of stock”. Hence, we are stuck here from editing the order.
What is the workaround for this issue?
For understanding this, you must have to know how the stock system is working. It works mainly on the Order Status. So we have 2 kinds of status: Positive and Negative.
Positive & Negative Order Status:
If you login to your Admin Panel. Go to System – Settings – Edit – Option Tab. Here you will see Processing order status and Complete order Status.

All the statuses that are marked in both the fields are considered Positive Status. Similarly, all the status that remains unmarked in both of them is considered Negative Status.
How does stock reduction works between Positive and Negative Order Status?
Order can either have positive order status or negative order status.
If the initial order status is positive, the stock gets reduced.
If the initial order status is negative, the stock stays the same.
When order status changes from
- From positive to negative: Stock will be added back.
- From negative to positive: Stock will be reduced.
- From positive to positive: Stock stays same,
- From negative to negative: Stock stays the same.
Example:
Suppose you have not marked Pending status in the system – settings – edit – options tab. So this is considered as Negative Status.
Now if you were facing a stock issue during order edit. You can go to the Order Information page and go to the History section. You will change the order status to Pending. As this is a negative status it would add the stock back. And you will be able to edit the order.
You can also have another order status like pending ( Ex: Payment awaited, on hold, etc ) which you have marked in the System – Setting Block. That status would add the stock back. As those are negative statuses.
Conclusion
So if you are facing an error with out of stock error during order edit then go to Order Information page. Change the order status to some status which is not marked in the System – Setting – Edit – Option Block.
By doing this, Stock would be added back and you will be able to edit the order.
Let us know if the above post was helpful by commenting below and you were able to solve the error.
Make customized Orders from the Backend
Customized One-page order entry system is an opencart extension for the store admin to make customized orders instantly from the back end. It provides you a single page for creating/editing orders with many features on the same page.
Additionally, you can create unique payment links for the order and send them to your client for the payment. It supports major payment gateways. Ex: Paypal Standard, Square Payment, etc.
Furthermore, you can also add extra charges, discounts, custom shipping/payment to the order.