I am basing this off of Qphoria's push download module: http://forum.opencart.com/viewtopic.php?t=10185
The following code is located in model/catalog/product.php under the editProduct function
Code: Select all
$product_qry = $this->db->query("SELECT price from " . DB_PREFIX . "product WHERE product_id = '" . (int)$product_id . "'");
$new_price = $product_qry->row['price'];
$order_qry = $this->db->query("SELECT quantity from " . DB_PREFIX . "order_product WHERE order_product_id = '" . $order_product_id . "'");
$product_quantity = $order_qry->row['quantity'];
$new_total = $product_quantity * $new_price;
$this->db->query("UPDATE " . DB_PREFIX . "order_product SET price = '" . $new_price . "' WHERE product_id = '" . (int)$product_id ."'");
$this->db->query("UPDATE " . DB_PREFIX . "order_product SET total = '" . $new_total . "' WHERE order_product_id = '" . (int)$order_product_id . "'");
Where and how would I define this variable?