debug quantity if condation
Build OpenCart Extension / build-release (push) Failing after 38s

This commit is contained in:
Mohamed Youssef
2026-04-12 20:10:05 +02:00
parent 3e7305a37f
commit 6e14d2a3c7
+1 -1
View File
@@ -9,7 +9,7 @@
<file path="catalog/model/checkout/order.php"> <file path="catalog/model/checkout/order.php">
<operation error="skip"> <operation error="skip">
<search><![CDATA[$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'");]]></search> <search><![CDATA[$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'");]]></search>
<add position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "product SET quantity = (quantity - " . (int)$order_product['quantity'] . "), status = IF((quantity - " . (int)$order_product['quantity'] . ") = 0, 0, 1) WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'");]]></add> <add position="replace"><![CDATA[$this->db->query("UPDATE " . DB_PREFIX . "product SET quantity = (quantity - " . (int)$order_product['quantity'] . "), status = IF((quantity - " . (int)$order_product['quantity'] . ") <= 0, 0, 1) WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'");]]></add>
</operation> </operation>
<operation error="skip"> <operation error="skip">
<search><![CDATA[$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'");]]></search> <search><![CDATA[$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'");]]></search>