Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Manufacturers Name or Image in Product info page


Guest

Recommended Posts

Posted

I am a little out of touch with coding so I need some help.. It has been several hours and I still can't get this right..

 

I would like to have the name of the manufacturer listed on the product page and the query pulls up a name, but not the right one.

 

Here's the code I have..

    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
// EOF MaxiDVD: Modified For Ultimate Images Pack!
// Get manufacturers_name for products

$mfr_query = tep_db_query("select manufacturers_name, manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$products['manufacturers_id'] . "'");

   $product_info = tep_db_fetch_array($mfr_query);


   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'] . ' by ' . $mfr['manufacturers_name'];
   }

 

Thanks for the help.. I'm sure it will take one of you less than a minute to figure out where my query is wrong.

 

Also, if you can, let me know the code to display the image for the manufacturer on the page also.

 

Thanks again!

 

-Mike

Archived

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

×
×
  • Create New...