If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / manufacturer image on manufacturer page

manufacturer image on manufacturer page

Locked

Started by bigbadboy on 28 Nov 2008, 2:47 PM · Views: 3,184

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
28 Nov 2008, 2:47 PM
#1
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Post #1 by bigbadboy

The thing about ZC is the hard things are easy to do, the simple things always seem to confuse me.

I want to display the manufacturer logo on the manufacturer page.

No doubt as soon as I post this I'll find a way but in the meantime if anyone can point me in the right direction I'd appreciate it!

Thanks.

1 Dec 2008, 12:22 PM
#2
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Post #2 by bigbadboy

Just to update:

I've simply taken this code and plonked it onto the product listing page:

<div class="centeredContent">' . zen_image(DIR_WS_IMAGES . $manufacturer_info_sidebox->fields['manufacturers_image'], $manufacturer_info_sidebox->fields['manufacturers_name']) . '</div>

Only problem is that it only shows the 'no image' image.

The relevant images do exist and this code works on the product info page, just not on the product listing.

Anyone know why?

1 Dec 2008, 3:17 PM
#3
ajeh avatar

ajeh

Oba-san

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

Post #3 by ajeh

You are using:

<div class="centeredContent">' . zen_image(DIR_WS_IMAGES . $manufacturer_info_sidebox->fields['manufacturers_image'], $manufacturer_info_sidebox->fields['manufacturers_name']) . '</div>

That isn't available on the Product Listing ...

You could use a function for this ...

How to find a function that could be used? Peek at the Tools ... Developers Tool Kit ... and see if the field you are looking for can be found by entering it into the bottom input box and selecting Catalog ...

Then, review the function to see what is being sent back to you and how to call that function to obtain the value ...

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!

2 Dec 2008, 1:49 AM
#4
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Post #4 by bigbadboy

I totally understand what you are saying and performed the search (for 'manufacturers_image') and got 22 results.
I then checked the pages that these results were on but simply couldn't see the wood for the trees!

I tried various options but nothing worked.

:frusty:

2 Dec 2008, 4:44 AM
#5
ajeh avatar

ajeh

Oba-san

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

Post #5 by ajeh

One function that looks rather appealing is the:

/includes/functions/functions_lookups.php

Line #362 : function zen_get_products_manufacturers_image($product_id) {

Try something like:

echo 'I AM THE IMAGE: '  . zen_get_products_manufacturers_image($product['id']);

Then, go adapt the results to displaying the image ...

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!

2 Dec 2008, 9:31 AM
#6
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Post #6 by bigbadboy

I am so missing something, still, as I simply cannot see what I am doing wrong (or more to the point, what I am supposed to be doing!).

I see what you're saying above but for some reason I am simply not getting it.

This is what I have:

case 'PRODUCT_LIST_NAME':
        $lc_align = '';
        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '
		  <div class="centeredContent">' . zen_get_products_manufacturers_image((int)$_GET['manufacturers_image']) . zen_image(DIR_WS_IMAGES . $check_image) . '</div>
		  <h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']),

But then I use the line, as mentioned,

case 'PRODUCT_LIST_NAME':
        $lc_align = '';
        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '
		  <div class="centeredContent">echo 'I AM THE IMAGE: '  . zen_get_products_manufacturers_image($product['id']);</div>
		  <h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']),

But obviously you cannot use echo in this instance.
I have tried different combinations but either they blank the page out or simply make no difference!

:no:

2 Dec 2008, 5:42 PM
#7
ajeh avatar

ajeh

Oba-san

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

Post #7 by ajeh

Sorry ... I have a typo on the products_id variable to use ... :eek:

But you have a mess ... :blink:

This code will display the manufacturers_image but you will want to rearrange it so that it displays where you want it on the listing ...

        case 'PRODUCT_LIST_NAME':
        $lc_align = '';

        $check_manufacturers_image = zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']));

        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '<h3 class="itemTitle">' . $check_manufacturers_image . '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
        } else {
          $lc_text = '<h3 class="itemTitle">' . $check_manufacturers_image . '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
        }
        break;

This will set a variable $check_manufacturers_image to be the manufacturers_image and then you can add it where you need it ...

You can jazz that up as well with ALT tags or sizes etc. ...

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!

2 Dec 2008, 9:01 PM
#8
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Post #8 by bigbadboy

As usual, Linda, you are a perfect help but in this case I simply couldn't get this working.

I know it's my lack of seeing what's right in front of me and I think, for now, I simply need to just leave this.

I detest admitting defeat but this one simply has me stumped!

4 Dec 2008, 4:47 AM
#9
ajeh avatar

ajeh

Oba-san

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

Post #9 by ajeh

Try this, in that case statement just add the lines:

        $check_manufacturers_image = zen_image(DIR_WS_IMAGES . zen_get_products_manufacturers_image($listing->fields['products_id']));
echo 'I SEE ' . $check_manufacturers_image . '<br>';

Then, when you run the Product Listing you will see "somewhere" on the page all the images ... they will just appear as a mess but the point is to test can you see them ...

Once you can see them, then you can add the variable:
$check_manufacturers_image

Somewhere on the two $lc_text lines to make them appear with each of the Products ...

Try it and see if that works for you ...

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!

27 Dec 2009, 9:00 AM
#10
amirgtr avatar

amirgtr

New Zenner

Join Date:
Mar 2009
Posts:
45
Plugin Contributions:
0

Post #10 by amirgtr

Old thread, I know, but I'm looking to add the same feature.

So, where do I put the code again? Specifically which file? I got the manufacturer image to work in the product info, but couldn't figure out the manufacturer product listing (aka. choosing one manufacturer and then clicking search).