Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show manufacturers name


zlack

Recommended Posts

Posted

Mattreicher pm'd me how to display the manufacturer and i though some ppl might find it usefull.

 

 

// Products manufacturer 

function tep_get_products_manufacturer($product_id) { 

$products_manufacturer_query = tep_db_query("SELECT manufacturers_id FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $product_id . "'"); 

$products_manufacturer = tep_db_fetch_array($products_manufacturer_query); 

$manufacturer_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = '" . $products_manufacturer['manufacturers_id'] . "'"); 

$manufacturer = tep_db_fetch_array($manufacturer_query); 



return ($manufacturer['manufacturers_name'] == "" ? "N/A" : $manufacturer['manufacturers_name']); 

}

 

 

Then you can call it with:

 

<?php echo tep_get_products_manufacturer($products_id); ?>

It's easier to remember, then to forget

  • 2 weeks later...
Posted

I wonder how can I list the manufacturer name in the orders. Is this way the best way? Or is there any easier way?

 

Thanks,

 

arbocenc

[email protected]

www.delaterra.net

organic food in Catalonia

Archived

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

×
×
  • Create New...