Forums / Templates, Stylesheets, Page Layout / Adding manuafactuers image to product listing

Adding manuafactuers image to product listing

Locked

Views: 1,088

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
20 Apr 2007, 12:51 AM
#1
paperzombie avatar

paperzombie

Zen Follower

Join Date:
Aug 2006
Posts:
100
Plugin Contributions:
0

Adding manuafactuers image to product listing

I looked all over the forums and I couldnt find anything that was up to date..
I want to add a little image that says "crafter" as well as the manufacturer's image to the product listing. Can someone point me to a place where I can find information on this?

20 Apr 2007, 4:35 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding manuafactuers image to product listing

The product listing content is built in /includes/modules/your_template/product_listing.php.

Find this section ```php

    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;
and you can add to the content of $lc_text.

You can access the manufacturer's id here $listing->fields['manufacturers_id'],
and use that to identify an image file to be called just before or after the <a href.../a> You would name the image files with a suffix of the mfr's id (mfr_img_27.jpg).

Get started and I can give you more pointers if you need them.
20 Apr 2007, 10:45 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding manuafactuers image to product listing

Oh, so you wanted it on the product info page, not the product listing page!

The product entry/editing page in admin has an option to list a "Products URL:" which you could use to find the code that does this. You may well be able to copy a chunk of code to your image output area.

20 Apr 2007, 11:00 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding manuafactuers image to product listing

This section of tpl_product_info_display.php outputs the mfr's link:

<!--bof Product URL -->
<?php
  if (zen_not_null($products_url)) {
    if ($flag_show_product_info_url == 1) {
?>
    <p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
<?php
    } // $flag_show_product_info_url
  }
?>
<!--eof Product URL -->

You could redefine TEXT_MORE_INFORMATION (if it's not used elsewhere) to read "Crafter"; or you may be able to replace "TEXT_MORE_INFORMATION" in the code with your call to the image so the image becomes the link (I haven't tried this and don't know if it will work properly.)

21 Apr 2007, 3:44 AM
#6
paperzombie avatar

paperzombie

Zen Follower

Join Date:
Aug 2006
Posts:
100
Plugin Contributions:
0

Re: Adding manuafactuers image to product listing

im lost.. so that code will make it a link??

21 Apr 2007, 4:55 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding manuafactuers image to product listing

That code displays text saying something like "visit this product's web page" which is a link to a URL which you enter in the product editing page.

You can find the language file where TEXT_MORE_INFORMATION is defined and change it to "Crafter", or maybe to a chunk of code which will be interpreted when run to equal a product-specific image plus link.
Or you could insert said chunk of code somewhere in the

<?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(... statement. I expect I could figure out the right formulation for that, but it would take a bit of research... and some trial & error (hopefully not too much error ;)