OpenCart 1.5.x以及2.x版本中,在后台编辑商品时,有设定是否减小库存(subtract)选项,若是选中了,则在后续订单中处理时会减小库存数量。 php
库存数量减小的机制因opencart版本不一样而不一样。 网站
在OpenCart 2.x系列版本中,库存数量的减小是经过以下路径的model文件处理的。
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 后台
//若是当前订单状态不是【处理中】或【已完成】状态,但要更换为的状态为【处理中】或【已完成】状态,则减小库存 model
该操做的触发事件是网站后台更改订单状态为【Processing(处理中)】或【Complete(已完成)】。 文件