Get the App
SLTechnology News&Howtos  ›  Network Security  › 

OpenCart 2.x system Commodity quantity inventory reduction Logic

Shulou Source: shulou.com Published: 2022-06-01 06:26:21 10月04日 Update

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)].

Tags: Inventory status processing quantity version different background order commodity event file mechanism website path system logic Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno MySQL vpn Redmi