Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add manufacturer to product info page


Guest

Recommended Posts

Do you want to display the manufacturers name on the product info page? I can't see why this wasn't done by default... luckily its easy to add:

 

In product_info.php change this query:

$product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, 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_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");

 

 

To this:

$product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "' and m.manufacturers_id = p.manufacturers_id");

 

Around line 82 change this:

<td colspan="2" class="pageHeading">' . $product_info_values['products_model'] . '</td>'

 

to this:

 <td colspan="2" class="pageHeading">' . $product_info_values['manufacturers_name'] . ' (' . $product_info_values['products_model'] . ')</td>'

 

This puts the manufacturers name first and the product model in (brackets). You can play with it to display it however you like!!

 

Please leave me a reply if you found this useful :D

Link to comment
Share on other sites

how can you get it to show a manufacture image instead of text in the product info page?

 

Hi, surelly your can do it through adding a shortcut to the image (create a new field in Your manufacturers db). I gues is as simple as the products image itself. Best Regards

Mark

Link to comment
Share on other sites

  • 1 month later...
Can you also add the product weight for product listing.

 

Thanks,

Nora Tam

 

All of the Product listing fields are configureable in Admin ... Configuration ... Product Listing ...

 

0= off ... 1= on ... other numbers will sort the list left to right in the number order you give.

Link to comment
Share on other sites

  • 7 years later...

Hello i am having an issue with this... i have tried to implement this mysql statement but it doesn't seem to work correctly it shows the wrong manufacturer.

 

I was wondering if anyone could help me regarding this.

Link to comment
Share on other sites

  • 1 year later...

I see where you are going with this...

 

I wanted to do away with the boxes all over the place and integrate them into the product_info.php. Here's how I did it. First you need to call the manufacturer info up into an array, like so:

 

 $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
$manufacturer = tep_db_fetch_array($manufacturer_query);

 

Put that just below $product_info_query.

 

Next, I want to call the info to the area I want on the product_info page, like so:

 

  <? echo BOX_MANUFACTURER_PROINFO_OTHER_PRODUCTS . '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</a>'; ?>

 

The text called BOX_MANUFACTURER_PROINFO_OTHER_PRODUCTS is in english.php. I created a new one for this instance, like so:

 

define('BOX_MANUFACTURER_PROINFO_OTHER_PRODUCTS', '<font color="#BABABA" size="1"><i>CLICK HERE FOR MORE PRODUCTS<br>FROM<br></i></font>');

 

I put that just under the original BOX_MANUFACTURER_INFO_OTHER_PRODUCTS. And that should do it.

 

TWEAK

If you want the text to be a hyperlink as well just rearrange it like this:

 

  <? echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">' . BOX_MANUFACTURER_PROINFO_OTHER_PRODUCTS . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</a>'; ?>

 

Then you might want to take the <font color="#BABABA">out of the english.php to keep it standard for your needs.

Link to comment
Share on other sites

the code is different in the 2.3 version ! somebody an idea how to show manufacturers name in the productpage? I also found that you can add a URL but i did'n see it in the productpage ! Why? How to fix it? thx

Link to comment
Share on other sites

  • 6 months later...

Do you want to display the manufacturers name on the product info page? I can't see why this wasn't done by default... luckily its easy to add:

 

In product_info.php change this query:

$product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, 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_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");

 

 

To this:

$product_info = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "' and m.manufacturers_id = p.manufacturers_id");

 

Around line 82 change this:

<td colspan="2" class="pageHeading">' . $product_info_values['products_model'] . '</td>'

 

to this:

 <td colspan="2" class="pageHeading">' . $product_info_values['manufacturers_name'] . ' (' . $product_info_values['products_model'] . ')</td>'

 

This puts the manufacturers name first and the product model in (brackets). You can play with it to display it however you like!!

 

Please leave me a reply if you found this useful biggrin.gif

 

Anyone - how to make manufacturers name a link ?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...