Forums / Templates, Stylesheets, Page Layout / Displaying manufacturers image on product page

Displaying manufacturers image on product page

Views: 7,809

Results 1 to 20 of 41
14 Jan 2009, 3:34 PM
#1
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Displaying manufacturers image on product page

Hi all,

Looking to display the manufacturers logo on my product info page.

I've copied the following code into my tpl_product_info_display.php file, but it just brings up the default "No Picture Available" image.

<?php 
echo zen_image(DIR_WS_IMAGES . $manufacturer_info_sidebox->fields['manufacturers_image'], $manufacturer_info_sidebox->fields['manufacturers_name']);
?>

I've tried copying the image into the images directory, the images/manufacturers directory, tried various filenames but still no joy.

Help! :smile:

14 Jan 2009, 4:34 PM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Probably need a bit more code to determine WHAT image to display - so it needs to know what PRODUCT by what MANUFACTURER is on display before it can find the image (as the PRODUCT is linked to the manufacturer).

Have you looked at:

includes/modules/sideboxes/manufacturer_info.php

15 Jan 2009, 11:18 AM
#3
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Do you know what bits i'd need to include in my product_info_display.php file?

15 Jan 2009, 2:39 PM
#4
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

I know more about neurosurgery than I do about PHP - and I never went to medical school.

You'll need a php guru to help you here.

15 Jan 2009, 3:11 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Displaying manufacturers image on product page

For displaying the manufacturer's image on the product_info page, try something like this:

<?php echo 'I see the manufacturers image: ' . zen_image(DIR_WS_IMAGES .  zen_get_products_manufacturers_image($product_info->fields['manufacturers_id'])); ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Jan 2009, 3:58 PM
#6
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Hi Ajeh,

With that I get the text "I see the manufacturers image" displaying and also the No Picture Available placeholder. :(

15 Jan 2009, 4:01 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

RobM:

Hi Ajeh,

With that I get the text "I see the manufacturers image" displaying and also the No Picture Available placeholder. :(

Could it be that you have not yet associated the product with its manufacturer...?

20 years a Zencart User

15 Jan 2009, 4:20 PM
#8
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Nope, all my products have a chosen Manufacturer.

I've uploaded the manufacturer image to the images directory and also the images/manufacturers but still nothing, can't understand why it's not picking it up.

15 Jan 2009, 4:24 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Any other mods installed??? (possible conflicts in php code???)

20 years a Zencart User

15 Jan 2009, 4:33 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Displaying manufacturers image on product page

RobM:

Hi Ajeh,

With that I get the text "I see the manufacturers image" displaying and also the No Picture Available placeholder. :(

Seems to work fine in v1.3.8 ... :unsure:

Try an echo on:

<?php echo 'I see the manufacturers_id: ' . $product_info->fields['manufacturers_id']; ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Jan 2009, 4:36 PM
#12
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

That seems to pull through:

I see the manufacturers_id: 6

15 Jan 2009, 4:53 PM
#13
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

RobM:

Hi Ajeh,

With that I get the text "I see the manufacturers image" displaying and also the No Picture Available placeholder. :(

Tried this on a bog-standard install of 1.3.8a too, and I get same as RobM

20 years a Zencart User

15 Jan 2009, 6:23 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Displaying manufacturers image on product page

What do you get if you echo this:

<?php echo 'I SEE: ' . zen_get_products_manufacturers_image($product_info->fields['manufacturers_id']); ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

16 Jan 2009, 9:20 AM
#15
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Hi Ajeh,

Get the following displaying:

I SEE

16 Jan 2009, 9:58 AM
#16
robm avatar

robm

New Zenner

Join Date:
Nov 2006
Posts:
88
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

And on the ones where I have uploaded logos:

I SEE: manufacturers/bosch-logo.gif

16 Jan 2009, 9:54 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Displaying manufacturers image on product page

Geeze louise ... can't you guys do what I mean and not what I say? :frusty:

Try using the right field ... silly me ... :blush:

<?php echo 'I see the : ' . zen_image(DIR_WS_IMAGES .  zen_get_products_manufacturers_image($product_info->fields['products_id'])); ?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

17 Jan 2009, 7:20 AM
#18
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

In the land of the blind, Linda, the one-eyed man is king...

You could tell us to insert a chapter of a Noddy story and we'd go ahead and do it. :D

20 years a Zencart User

17 Jan 2009, 3:43 PM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Displaying manufacturers image on product page

This is true ...

Fortunately ... it is all really a lesson for the lemmings ... did you try pressing this button over here? :lamo:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Feb 2009, 3:38 PM
#20
creative avatar

creative

New Zenner

Join Date:
Jul 2005
Posts:
85
Plugin Contributions:
0

Re: Displaying manufacturers image on product page

Fantastic! This is exactly what I was looking for during my visit to the forums today. Thank you.

But of course I have a question. By following Ajeh's last post and placing the code in tpl_product_info_display.php I am able to see the manufacturer's logo displayed on the product info page. However, we do not want to display a manufacturer logo for every product on our site. I thought this could be accomplished by selecting "none" from the manufacturer dropdown when adding products to the inventory. What happens instead is the "Manufactured by" does not display, but the "no image available" graphic does.

Here's the modified section of my template file:

<!--bof Product details list  -->
<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
  <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
  <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
  <!-- original php code to display manufacturer name =^sg^=
  <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?> -->
  <!--bof modified php code to remove text of manufacturer name =^sg^= -->
  <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . '</li>' : '') . "\n"; ?>
  <!--eof mmodified code -->
  <!--bof display manufacturer image on page =^sg^= -->
  <?php echo ' ' . zen_image(DIR_WS_IMAGES .  zen_get_products_manufacturers_image($product_info->fields['products_id'])); ?>
  <!--eof display-->
</ul>
<br class="clearBoth" />
<?php
  }
?>
<!--eof Product details list -->

Did I perhaps paste the code in the wrong part of the tpl_product_info_display.php file? Should the scrap of code that enables the display of the manufacturer image be somehow linked to the manufacturer dropdown option available when adding new products? That way, when a manufacturer of "none" is selected when adding a product, the code will not ask for a manufacturer image?

Our store is Zen Cart version 1.3.8a with PHP version 5.2.5 and MySQL 4.1.22.