Forums / Templates, Stylesheets, Page Layout / display manufacturer image in product listing?

display manufacturer image in product listing?

Views: 7,276

Results 1 to 20 of 48
13 Nov 2011, 7:52 AM
#1
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

display manufacturer image in product listing?

I'm looking to display the manufacturer image in lieu of the manufacturer name. Has anyone done this?

I was thinking this[1] would work but I don't know where to put it.

ref.
[1]

<!--bof display manufacturer image on page--> <?php $chk_manufacturers_image = zen_get_products_manufacturers_image($product_info->fields['products_id']); echo (!empty($chk_manufacturers_image) ? zen_image(DIR_WS_IMAGES . $chk_manufacturers_image) : ''); ?> <!--eof display-->
13 Nov 2011, 8:10 AM
#2
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

k. I think I'm a little further ahead now. Never fails, as soon as I post something I find more info on my own...Anyway.

In ../modules/my_theme/product_listing.php I found:

    break;
    case 'PRODUCT_LIST_MANUFACTURER':
    $lc_align = '';
    $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
    break;

Would integrating the aforementioned code in that work?

13 Nov 2011, 2:11 PM
#4
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Those are both for the manufacturer sidebox. I'm looking for the product listing page. When you enable Display Product Manufacturer Name it adds a column to the product listing page. I'd really like to add the manufacturers image in there. Instead of the manufacturers name.

13 Nov 2011, 2:17 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: display manufacturer image in product listing?

You could customize with your templates and overrides the module:
/includes/modules/product_listing.php

and add the code:

zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name'])

where you want the image to show ...

Example: for the Manufacturers Name you can add it to:

        case 'PRODUCT_LIST_MANUFACTURER':
        $lc_align = '';
        $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '<br>' . zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name']) . '</a>';
        break;

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!

13 Nov 2011, 3:05 PM
#6
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Hm. I don't understand how to implement that.

Am I replacing this:

case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
break;

w/this:

zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name'])
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '<br>' . zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name']) . '</a>';
break;

Or am I putting the image statement somewhere else?

13 Nov 2011, 3:08 PM
#7
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Nevermind. Got it!

Didn't realize you had already broken it down for me.

13 Nov 2011, 3:09 PM
#8
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

oh, and...Thank you! :)

13 Nov 2011, 3:20 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: display manufacturer image in product listing?

You are most welcome and thanks for the update that this is now working for you ... :smile:

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!

8 Dec 2011, 1:57 AM
#10
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Now that time has passed I'm finding I don't fancy the manufacturer name AND the image.

How do I strip the name and keep the image?

8 Dec 2011, 1:58 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: display manufacturer image in product listing?

Take the name out of the code:

$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '<br>' . zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name']) . '</a>';

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!

8 Dec 2011, 3:44 PM
#12
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Interesting...That worked perfectly for what I wanted except that now in the product_info I no longer have the manufacturer listed ie Manufactured by: is blank.

Here's the code[1] I'm using now...Not clear on how/why this would also strip the display from another page. I'm inclined to think that in searching for my above solution I may have been slightly over-zealous in removing things with the term "manufacturer name" perhaps?

ref.

// BoF DISPLAY MANUFACTURER IMAGES
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name']) . '</a>';
break;
//EoF DISPLAY MANUFACTURER IMAGES

8 Dec 2011, 3:46 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: display manufacturer image in product listing?

The change to that file should only affect the listings ...

If you changed other files, you need to look and see what changes you made and adjust them accordingly ...

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!

8 Dec 2011, 3:48 PM
#14
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Ajeh:

The change to that file should only affect the listings ...

If you changed other files, you need to look and see what changes you made and adjust them accordingly ...

Thought so...Just wanted to be certain. So here's[1] where I 'tinkered' in product_info_display.php

ref.
[1] <!--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>
<?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"; ?>
<?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $chk_manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<?php } ?>
<!--eof Product details list -->

8 Dec 2011, 3:53 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: display manufacturer image in product listing?

What is this suppose to be:
$chk_manufacturers_name

If you are testing whether or not there is a Manufacturers Name with:
$manufacturers_name

Why are you using a different variable for the Manufacturers Name that does not appear to exist in the code you listed?

What happens if you change it to be:
$manufacturers_name

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!

8 Dec 2011, 3:56 PM
#16
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

In comparing the above with the ZC source I'm not seeing anything different. There was one point when I attempted to add the manufacturer image to that page also and I removed that code while editing - I know always edit one thing at a time! Here's the code[1] I had in place. Perhaps that somehow enabled the displaying of the manufacturer!?

ref.
[1] <!--BoF display manufacturer image-->

<?php $chk_manufacturers_image = zen_get_products_manufacturers_image($product_info->fields['products_id']); echo (!empty($chk_manufacturers_image) ? zen_image(DIR_WS_IMAGES . $chk_manufacturers_image) : ''); ?> <!--EoF display manufacturer image-->
8 Dec 2011, 4:00 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: display manufacturer image in product listing?

That was to get the image ... and only display it if there was one ...

What do you want to see on the product_info page? :unsure:

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!

8 Dec 2011, 4:00 PM
#18
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Ajeh:

What is this suppose to be:
$chk_manufacturers_name

If you are testing whether or not there is a Manufacturers Name with:
$manufacturers_name

Why are you using a different variable for the Manufacturers Name that does not appear to exist in the code you listed?

What happens if you change it to be:
$manufacturers_name

Spot on!
details...details...details.

Thank you!

8 Dec 2011, 4:02 PM
#19
familynow avatar

familynow

Zen Follower

Join Date:
Aug 2011
Location:
Near Ottawa, Ontario, Canada
Posts:
321
Plugin Contributions:
0

Re: display manufacturer image in product listing?

Ajeh:

That was to get the image ... and only display it if there was one ...

What do you want to see on the product_info page? :unsure:

I pulled the plug on that because I felt it was just too much to load even-tough it looked good. I've got the manufacturer logo for branding in the product_list and only the name in the product_info I think that's the best compromise for sales/performance.

28 Apr 2012, 12:14 AM
#20
tamdoll avatar

tamdoll

New Zenner

Join Date:
Feb 2012
Posts:
22
Plugin Contributions:
0

Re: display manufacturer image in product listing?

It's driving me crazy... I've edited my product_listing.php to have the manufacturer's image appear in product listing & I can't figure out why it's not showing. A product listing at site is: http://spottedsheepyarnshoppe.com/zencart/index.php?main_page=product_info&cPath=20_21_23&products_id=37 and edit in .php is below. Please help!

case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '<br>' . zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']), $listing->fields['manufacturers_name']) . '</a>';
break;