This commit is contained in:
+13
-2
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user