OpenCart 2.x system Commodity quantity inventory reduction Logic
In OpenCart versions 1.5.x and 2.x, the subtract option is set when editing items in the background, and if selected, the inventory quantity is reduced when processed in subsequent orders.
The mechanism for inventory reduction varies from version to version of opencart.
In the OpenCart 2.x series version, the reduction in inventory is handled through the model file in the following path.
Catalog/model/checkout/order.php
/ / If current order status is not processing or complete but new status is processing or complete then commence completing the order
/ / if the current order status is not [in processing] or [completed] status, but the status to be changed to [processing] or [completed] status, reduce inventory
The trigger event for this action is that the website backend changes the order status to [Processing (processing)] or [Complete (completed)].