Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Manufacturer name in admin/orders.php


jarrod

Recommended Posts

  • 4 weeks later...

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

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...