Files
opencart-automation-suite/install.xml
T
Mohamed Youssef 3e7305a37f
Build OpenCart Extension / build-release (push) Successful in 35s
debug extension code
2026-04-10 20:18:37 +02:00

27 lines
1.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<modification>
<name><![CDATA[Automation Suite]]></name>
<code>automation-suite</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>
<add position=""><![CDATA[]]></add>
</operation>
</file>
</modification>