Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I add the MFR IMG to tpl_index_product_list.php?

How do I add the MFR IMG to tpl_index_product_list.php?

Locked

Views: 1,501

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
21 Jun 2008, 8:41 PM
#1
molywerks avatar

molywerks

Zen Follower

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

How do I add the MFR IMG to tpl_index_product_list.php?

Hello, I need some help adding the manufacturer's image to the top of tpl_index_product_list.php. Maybe this is simple, maybe it isn't. I don't know. My PHP skills are lacking. I've looked hinder and yawn, tried copy'n'pasting/transforming various code, and come up empty. Here is what I feel might be pertinent in leading to a solution involves the following...

Right now, I see the manufacturer's name is displayed via some breadcrumb function in tpl_index_product_list.php:

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

...which becomes the following HTML:

<h1 id="productListHeading">Acme</h1>.

...once the web page is rendered listing the manufacturer's products. I'd like the above HTML source code to look like:

<h1 id="productListHeading">Acme</h1>
<img src="images/manufacturers/acme.gif" />.

If the manufacturer's image is not easily added, is it possible -- because the breadcrumb value will uniquely exist somewhere in zen_manufacturers . manufacturers_name -- to use PHP/SQL/HTML code that will:

  1. Compare the value of $breadcrumb->last(); to all the values in zen_manufacturers . manufacturers_name.
  2. Then grab the corresponding value from zen_manufacturers . manufacturers_image.
  3. And then output that value in tpl_index_product_list.php, e.g. <?php echo '<img src="' . $manufacturers->fields['manufacturers_image'] . '" />'; ?>.
    What bit of code will accomplish these three tasks or is this much more complicated than I think it ought to be?
21 Jun 2008, 11:10 PM
#2
molywerks avatar

molywerks

Zen Follower

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

Re: How do I add the MFR IMG to tpl_index_product_list.php?

Oops. Would a forum mod please move this to Zen Cart Support > Customizing the Look of Your Shop > Page Layout Changes? Thank you.

22 Jun 2008, 4:18 AM
#4
molywerks avatar

molywerks

Zen Follower

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

Re: How do I add the MFR IMG to tpl_index_product_list.php?

Thanks, Linda. Will remember to try keywords like "manufacturers_image" because googling searches similar to:

manufacturers image index OR "product listing" site:http://www.zen-cart.com/forum/

...didn't return a result for the linked thread you've provided because I spelled everything correctly. :)

I'll try to follow How Do I Put Manufactor Image In Product Listing Page? but that looks like a replacement rather than addition. Replacement is easy! I've already done that... oh, I'll just shut up and see if any of that works. :) Thanks again.

ALSO, is below possible??? I'd like to know because if it is, that'll be atop my "PHP-MySQL to learn" list.

If the manufacturer's image is not easily added, is it possible -- because the breadcrumb value will uniquely exist somewhere in zen_manufacturers . manufacturers_name -- to use PHP/SQL/HTML code that will:

  1. Compare the value of $breadcrumb->last(); to all the values in zen_manufacturers . manufacturers_name.
  2. Then grab the corresponding value from zen_manufacturers . manufacturers_image.
  3. And then output that value in tpl_index_product_list.php, e.g. <?php echo '<img src="' . $manufacturers->fields['manufacturers_image'] . '" />'; ?>.

What bit of code will accomplish these three tasks or is this much more complicated than I think it ought to be?

22 Jun 2008, 4:39 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: How do I add the MFR IMG to tpl_index_product_list.php?

If it replaces correctly ... I bet you could get the same code to work in another place correctly without replacing things ... :smile: