订单成功后,"subtract stock" 出现在哪个.php 文件中?

In which .php file does the "subtract stock" happens after a successful order?

我正在使用 Opencart v.2.1.0.2 并且我试图找到 .php 文件"subtract stock" 在订单成功后发生。

有人可以帮忙吗?

谢谢!

您可以在\catalog\model\checkout\order.php

中查找

商品数量更新

$this->db->query("UPDATE " . DB_PREFIX . "product SET quantity = (quantity - " . (int)$order_product['quantity'] . ") WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'");

商品选项数量更新

$this->db->query("UPDATE " . DB_PREFIX . "product_option_value SET quantity = (quantity - " . (int)$order_product['quantity'] . ") WHERE product_option_value_id = '" . (int)$option['product_option_value_id'] . "' AND subtract = '1'");

虽然有补货查询,但如果订单被取消。