jarrod Posted August 5, 2005 Share Posted August 5, 2005 I need to display the manufacturer name right before the product name in orders.php, anybody have any idea how to do this? Link to comment Share on other sites More sharing options...
jarrod Posted August 6, 2005 Author Share Posted August 6, 2005 top Link to comment Share on other sites More sharing options...
logiczero Posted September 4, 2005 Share Posted September 4, 2005 Put this code in /admin/includes/functions/general.php: //// // Return the manufacturers name // TABLES: products, manufacturers function tep_get_product_manufacturer_name($products_id) { $manufacturer_query = tep_db_query("select m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . $products_id . "' and m.manufacturers_id = p.manufacturers_id"); $manufacturer = tep_db_fetch_array($manufacturer_query); return $manufacturer['manufacturers_name']; } In /admin/includes/classes/order.php, change line 81 from: $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'"); to: $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 . "'"); and add 'id' => $orders_products['products_id'], just after line 83: 'qty' => $orders_products['products_quantity'], Then change line 227 in /admin/orders.php from: ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; to: ' <td class="dataTableContent" valign="top">' . tep_get_product_manufacturer_name($order->products[$i]['id']) . ' ' . $order->products[$i]['name']; Line numbers are all based on modified code, so they may not perfectly line up with line numbers in your files. Also, I'm kind of a hack at SQL queries, so perhaps someone can suggest a better way of looking up manufacturer's name by product ID. Link to comment Share on other sites More sharing options...
yopyop22 Posted October 26, 2005 Share Posted October 26, 2005 ok it's work very fine But how can i do that direcly in a list of order with the customers_name thanks i forgot sorry for my english i'm a french canadian Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.