OpenCart 2.x system Commodity quantity inventory reduction logic

Source: Internet
Author: User
Tags opencart

OpenCart 1.5.x and 2.x versions, when editing a product in the background, there is a setting to reduce the inventory (subtract) option, and if selected, will reduce the inventory quantity when processed in subsequent orders.

The mechanism for reducing inventory quantity differs depending on the OpenCart version.

In the OpenCart 2.x series version, the reduction in inventory quantity is handled by the model file of the following path.
catalog/model/checkout/order.php

If Current order status was not processing or complete but new status was processing or complete then commence completing The order

Reduce inventory If the current order status is not in the in process or completed state, but is to be replaced with a status of in process or completed

The trigger event for this action is the site background Change Order status of "processing (in process)" or "complete (completed)".

OpenCart 2.x system Commodity quantity inventory reduction logic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.