Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Show manufacturers name


  • You cannot reply to this topic
1 reply to this topic

#1 zlack

  • Community Member
  • 196 posts
  • Real Name:zlack
  • Location:Netherlands

Posted 22 May 2003, 21:39

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 arbocenc

  • Community Member
  • 56 posts
  • Real Name:Arbo Cenc
  • Location:Barcelona (Catalonia, Europe)

Posted 31 May 2003, 18:11

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