first commit
Build OpenCart Extension / build-release (push) Failing after 4m6s

This commit is contained in:
Mohamed Youssef
2026-04-10 20:10:00 +02:00
parent 0cb8ca0f46
commit e716e9aee2
2 changed files with 34 additions and 18 deletions
+13 -2
View File
@@ -1,11 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name></name>
<code></code>
<name><![CDATA[Product Phase out]]></name>
<code><![CDATA[disable product when out of stock]]></code>
<author><![CDATA[<b style="color: green">MY-Dev | </b><b>Mohamed Youssef</b>]]></author>
<link>https://my-dev.pro</link>
<version>1.0.0</version>
<file path="catalog/model/checkout/order.php">
<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>
<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 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>
<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, 1, status) WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'");]]></add>
</operation>
</file>
<file path="">
<operation error="skip">
<search><![CDATA[]]></search>