Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with creating tep_get_manufacturer_name


skeedo

Recommended Posts

Posted

I'm really close, I think!

 

function tep_get_manufacturer_name($cPath) { 

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

$products_manufacturer = tep_db_fetch_array($manufacturer_query); 



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



}

 

Put <?php echo tep_get_manufacturers_name($cPath); ?> in manufacturer_info.php and it displayed a manufacturer, just not the right one.

Posted

$cPath is the category path.

 

Don't you really want to test for the $products_id?

 

Then call it with the current products products_id

Posted

Ooh man I'm so close this is what I have:

 

function tep_get_manufacturer_name($products_id) { 

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

$products_manufacturer = tep_db_fetch_array($manufacturer_query); 



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



}

 

When I echo it out with $products_id it just returns N/A.....

Archived

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

×
×
  • Create New...