vqmod_decimal_product_value_oc_3x.xml (6298B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <modification> 3 <id>Replace the code of the mode file for decimal value </id> 4 <version>1.0</version> 5 <vqmver>2.X</vqmver> 6 <author>Self</author> 7 <file name="admin/model/catalog/product.php"> 8 <operation> 9 <search position="replace"><![CDATA[ 10 (int)$data['quantity'] 11 ]]></search> 12 <add><![CDATA[ 13 (float)$data['quantity'] 14 ]]></add> 15 </operation> 16 </file> 17 <file name="system/library/cart/cart.php"> 18 <operation> 19 <search position="replace"><![CDATA[ 20 $this->db->query("INSERT " . DB_PREFIX . "cart SET api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "', customer_id = '" . (int)$this->customer->getId() . "', session_id = '" . $this->db->escape($this->session->getId()) . "', product_id = '" . (int)$product_id . "', recurring_id = '" . (int)$recurring_id . "', `option` = '" . $this->db->escape(json_encode($option)) . "', quantity = '" . (int)$quantity . "', date_added = NOW()"); 21 22 ]]></search> 23 <add><![CDATA[ 24 $this->db->query("INSERT " . DB_PREFIX . "cart SET api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "', customer_id = '" . (int)$this->customer->getId() . "', session_id = '" . $this->db->escape($this->session->getId()) . "', product_id = '" . (int)$product_id . "', recurring_id = '" . (int)$recurring_id . "', `option` = '" . $this->db->escape(json_encode($option)) . "', quantity = '" . (float)$quantity . "', date_added = NOW()"); 25 ]]></add> 26 </operation> 27 <operation> 28 <search position="replace"><![CDATA[ 29 $this->db->query("UPDATE " . DB_PREFIX . "cart SET quantity = (quantity + " . (int)$quantity . ") WHERE api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "' AND product_id = '" . (int)$product_id . "' AND recurring_id = '" . (int)$recurring_id . "' AND `option` = '" . $this->db->escape(json_encode($option)) . "'"); 30 31 ]]></search> 32 <add><![CDATA[ 33 $this->db->query("UPDATE " . DB_PREFIX . "cart SET quantity = (quantity + " . (float)$quantity . ") WHERE api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "' AND product_id = '" . (int)$product_id . "' AND recurring_id = '" . (int)$recurring_id . "' AND `option` = '" . $this->db->escape(json_encode($option)) . "'"); 34 ]]></add> 35 </operation> 36 <operation> 37 <search position="replace"><![CDATA[ 38 $this->db->query("UPDATE " . DB_PREFIX . "cart SET quantity = '" . (int)$quantity . "' WHERE cart_id = '" . (int)$cart_id . "' AND api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "'"); 39 ]]></search> 40 <add><![CDATA[ 41 $this->db->query("UPDATE " . DB_PREFIX . "cart SET quantity = '" . (float)$quantity . "' WHERE cart_id = '" . (int)$cart_id . "' AND api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "'"); 42 ]]></add> 43 </operation> 44 </file> 45 <file name="catalog/controller/checkout/cart.php"> 46 47 <operation> 48 <search position="replace"><![CDATA[$quantity = (int)$this->request->post['quantity'];]]></search> 49 <add><![CDATA[ 50 $quantity = (float)$this->request->post['quantity']; 51 ]]></add> 52 </operation> 53 </file> 54 <file name="catalog/model/checkout/order.php"> 55 <operation> 56 <search position="replace"><![CDATA[$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");]]></search> 57 <add><![CDATA[ 58 $this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', quantity = '" . (float)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'"); 59 ]]></add> 60 </operation> 61 <operation> 62 <search position="replace"><![CDATA[ 63 $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'"); 64 ]]></search> 65 <add><![CDATA[ 66 $this->db->query("UPDATE `" . DB_PREFIX . "product` SET quantity = (quantity + " . (float)$order_product['quantity'] . ") WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'"); 67 ]]></add> 68 </operation> 69 <operation> 70 <search position="replace"><![CDATA[ 71 $this->db->query("UPDATE " . DB_PREFIX . "product_option_value SET quantity = (quantity + " . (int)$order_product['quantity'] . ") WHERE product_option_value_id = '" . (int)$order_option['product_option_value_id'] . "' AND subtract = '1'"); 72 ]]></search> 73 <add><![CDATA[ 74 $this->db->query("UPDATE " . DB_PREFIX . "product_option_value SET quantity = (quantity + " . (float)$order_product['quantity'] . ") WHERE product_option_value_id = '" . (int)$order_option['product_option_value_id'] . "' AND subtract = '1'"); 75 ]]></add> 76 </operation> 77 78 </file> 79 </modification>