Forums / Templates, Stylesheets, Page Layout / Adding Manufacturer Logo on top of a product listing

Adding Manufacturer Logo on top of a product listing

Locked

Started by ec_junior on 15 Jan 2008, 5:18 PM · Views: 2,589

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
15 Jan 2008, 5:18 PM
#1
ec_junior avatar

ec_junior

New Zenner

Join Date:
Jan 2008
Posts:
5
Plugin Contributions:
0

Adding Manufacturer Logo on top of a product listing

Hi everyone,
I am wondering if anyone knows how to add the manufacturer's logo on top of the all product listings.

8 Feb 2008, 9:01 AM
#3
predmond avatar

predmond

New Zenner

Join Date:
Apr 2007
Posts:
36
Plugin Contributions:
0

Re: Adding Manufacturer Logo on top of a product listing

Find this file:
includes/templates/template_default/templates/tpl_index_product_list.php

You should not modify this file directly as if you upgrade, it will be overridden. Also, by using the override system, if you make a mistake and ruin everything, you can delete your file, and it all comes good again.

So what you need to do is save the file into includes/templates/YOUR_TEMPLATE/templates/tpl_index_product_list.php
Now you can make the changes.

On line 19 you should see this:

<h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1>

Just before this, place a link to your image, and any text you may want. It should make it display like the example site.

8 Feb 2008, 10:33 AM
#4
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Adding Manufacturer Logo on top of a product listing

Hold on...

Redmond is suggesting you HARD CODE a core file. This won't do the job.

The example site: http://www.scrapbookersplayground.com

Is using the CATEGORY feature to display the manufacturer logo at the header. All they have done is set up "manufacturers" as "product categories", then used the inherent zencart feature to add images to the categoy descriptions.

If you want to display the product manufacturer image then you are going to have to patch in some custom PHP code, so that the reference is called from the database (or appropriate image folder) dynamically.

You won't achieve this with a static hard-coded line.

(And besides... in general it's not really good practice to hard-code a php file).

20 years a Zencart User

9 Feb 2008, 12:47 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding Manufacturer Logo on top of a product listing

An alternative approach would be to use the Manufacturers Info Plus sidebox. This will show up whenever a listing is requested for a particular manufacturer.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

11 Feb 2008, 9:44 PM
#6
predmond avatar

predmond

New Zenner

Join Date:
Apr 2007
Posts:
36
Plugin Contributions:
0

Re: Adding Manufacturer Logo on top of a product listing

Sorry - schoolboy is correct. I misread the post as wanting the store logo on top of all product listing...

Interesting that you say it is not good practice to hard code a PHP file. Why is this, particularly using overrides??

14 Feb 2008, 7:04 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Adding Manufacturer Logo on top of a product listing

I've hard-coded files in the past - and still do so, but it's generally sloppy - and in some cases, can detrimentally affect performance (like hard coded external http:// references, when the system defaults to https:// - you'll get a IE warning message every time a visitor click a link in https://). Also, using multiple languages can be affected.

It's far better practice to build references to other elements, such as hyperlinks etc - either as defines in other php pages or the database.

20 years a Zencart User

23 Feb 2008, 2:30 AM
#8
beth_katherine avatar

beth_katherine

Zen Follower

Join Date:
Feb 2007
Posts:
158
Plugin Contributions:
0

Re: Adding Manufacturer Logo on top of a product listing

Is it too late to chime in with a question?

Can you exchange the manufacturer's NAME= 'productListHeading' for an image?

I would like to do this if possible. In other words I want to exchange the font for an image of a font of my choice.

Beth-Katherine

23 Feb 2008, 9:43 AM
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Adding Manufacturer Logo on top of a product listing

As an answer to the question that kicked this thread off, it turns out that most of the work has already been done for you by Zen Cart. It's just not actually used in practise. Over-riding the tpl_index_product_list.php with one that adds the following immediately after the section that generates the category image should give the desired effect.

<?php // manufacturers image
if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { ?>
<div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $image, $breadcrumb->last()); ?></div>
<?php
}
?>

Beth-Katherine

For your specific question there are a number of possible answers depending upon where you planned to get the images from. The complexity is in recognizing the images, unless you would be happy to use the main manufacturers image for this purpose.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)