PDA

View Full Version : Margin Report v1.00



michael_s
07-16-2007, 12:17 AM
After installing 2.56a, I came across an error in Order.php when a customer viewed their order information from the My Account page. As this contribution was the only one I had installed that editted /catalog/includes/classes/order.php I had a close look at the intall instructions and found the problem.

/catalog/includes/classes/order.php
Find:
$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$this->products[$index] = array('qty' => $orders_products['products_quantity'],
'id' => $orders_products['products_id'],
'name' => $orders_products['products_name'],
'model' => $orders_products['products_model'],
'tax' => $orders_products['products_tax'],
'price' => $orders_products['products_price'],
'final_price' => $orders_products['final_price']);

Replace With:
$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$this->products[$index] = array('qty' => $orders_products['products_quantity'],
'id' => $orders_products['products_id'],
'name' => $orders_products['products_name'],
'model' => $orders_products['products_model'],
'tax' => $orders_products['products_tax'],
'price' => $orders_products['products_price'],
'cost' => $orders_products['products_cost'],
'final_price' => $orders_products['final_price'],


The last line of the replacement:
'final_price' => $orders_products['final_price'],

Should actually be:
'final_price' => $orders_products['final_price']);

The attached file is the install instructions with this change.

More... (http://www.oscommerce.com/community/contributions,1594)