Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Add manufacturer to product info page


12 replies to this topic

#1 reemo

  • Community Member
  • 76 posts
  • Real Name:Jeremy

Posted 17 February 2003, 23:23

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

#2 Waza04

  • Banned
  • 680 posts
  • Real Name:Warren Ashcroft
  • Gender:Male

Posted 19 February 2003, 23:14

I cant seem to get this to work!!

Whenever I go onto a product, it always show the manufacturer with ID 1 - Canon!!

Whats wrong?

#3 Waza04

  • Banned
  • 680 posts
  • Real Name:Warren Ashcroft
  • Gender:Male

Posted 19 February 2003, 23:25

:oops:

Nevermind, forgot to add the last little bit of code!!

#4 johnnyosc

  • Community Member
  • 152 posts
  • Real Name:johnny

Posted 27 February 2003, 09:30

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

#5 mark_fijama

  • Community Member
  • 3 posts
  • Real Name:Marek Fijalkowski
  • Location:Poland

Posted 27 February 2003, 16:10

"johnnyosc" said:

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

#6 Paul Luu

  • Community Member
  • 1 posts
  • Real Name:Paul Luu
  • Location:diamond bar, ca

Posted 24 April 2003, 02:38

Can you also add the product weight for product listing.

Thanks,
Nora Tam

#7 cashflow202

  • Community Member
  • 47 posts
  • Real Name:Nora
  • Location:Diamond Bar, CA

Posted 26 April 2003, 20:32

test

#8 Ajeh

  • Community Member
  • 6,327 posts
  • Real Name:Linda McGrath
  • Location:Ohio

Posted 27 April 2003, 03:48

Quote

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.

#9 sk8ash

  • Community Member
  • 4 posts
  • Real Name:Ashley

Posted 29 September 2010, 15:29

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.

#10 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 04 February 2012, 06:59

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.

Edited by geomilli, 04 February 2012, 07:04.


#11 kozak

  • Community Member
  • 66 posts
  • Real Name:Kozak
  • Gender:Male
  • Location:Antwerp Belgium

Posted 08 February 2012, 18:13

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

#12 johnsellinge

  • Banned
  • 1 posts
  • Real Name:John Sellinge
  • Gender:Male

Posted 09 February 2012, 11:28

Try these Kozak.

Edited by Jan Zonjee, 09 February 2012, 22:04.
spam links removed


#13 kozak

  • Community Member
  • 66 posts
  • Real Name:Kozak
  • Gender:Male
  • Location:Antwerp Belgium

Posted 09 February 2012, 19:36

is this the new way to be helpfull by sending links to nowhere?