Adding manufacturer's logo to products
Hi
I'm new to Zencart and PHP. I need to display the manufacturer's logo above all the product images.
I have found a couple of old threads that I thought might help and have been trying to include extra code into an override tpl_index_product_list.php that will pull the manufacturer's image uploaded via the admin system and place it in a div above the product images.
So far my success is limited to knowing I am working on the correct file as I've managed to make the page disappear a couple of times!
:oops:
Could some kind and knowledgeable person perhaps post the code that I need to insert? I would be most grateful.
Thank you
Jennie
Re: Adding manufacturer's logo to products
A search on:
manufacturers_image
will give you numerous posts on how to display the manufacturer's image on various areas on the Catalog ... that may help get you started on this ... :smile:
Re: Adding manufacturer's logo to products
Quote:
Originally Posted by
Ajeh
A search on:
manufacturers_image
will give you numerous posts on how to display the manufacturer's image on various areas on the Catalog ... that may help get you started on this ... :smile:
Hi Ajeh
Thank you for your reply, I have searched as you suggested and wanted to try the suggestion on one of your previous posts to replace the product_listing.php case statement with:
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'])) . '<br>' . $listing->fields['manufacturers_name'] . '</a>';
break;
However am using the 3 column addon module so this had no effect - I thought this was because it only applied to if row layout was true, but changing to row layout still displayed nothing.
Is there anything I have to do besides adding the code? I have the manufacturers set up with their logos as images, and the products have been associated with the images.
Seems to me there must be a simple way to call this image in but I am so new to all this stuff I can't see how everything fits together.
Any help would be most appreciated.
Many thanks
A very boggled Jennie
:blink:
Re: Adding manufacturer's logo to products
Keep in mind that where you have that listed will only work if you have the manufactuer turned on in the Product Listing ...
Your code works fine for me ... be sure you have it in the right file ...
If you are using overrides then it needs to be in the override file ...
Re: Adding manufacturer's logo to products
Hi Ajeh
Sorry for intermittent communication, I come in one day a week to work on this job.
Thank you so much for your help, I am now getting a logo appearing.
:clap:
However I want to remove the text with the manufacturer's name and just have the logo on its own.
Tried removing a likely looking section of the code but the whole section disappeared again!
Any chance you could advise me which bit or bits needs removing?
Thanks again
Best wishes
Jennie
Re: Adding manufacturer's logo to products
I am assuming in the tpl_product_info_display.php you added it to this line:
Code:
<?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
Or, you added it separately and want to get rid of that line ...
Notice, that has a setting on whether or not to display the manufacturer's name or not ...
If you are not using that line of text on your logo display, then just turn it off in your Zen Cart Admin in the Catalog ... Product Type ... EDIT LAYOUT ... :smile:
If you are using that code as part of your logo display, then the manufacture's name is the;
$manufacturers_name
The text in front of the manufacturer's name is the:
TEXT_PRODUCT_MANUFACTURER
Re: Adding manufacturer's logo to products
And now that I think I answered your question totally wrong for the Product Listing and answered more for the product _info page ... I shall try again ... :blush:
Code:
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'])) . '<br>' . $listing->fields['manufacturers_name'] . '</a>';
break;
The section in read is adding a line break and the manufacturers_name, just remove that part ...
Re: Adding manufacturer's logo to products
Hi Ajeh
I swear that was the bit I removed before when the page disappeared! Got it now, thank you so much.
I haven't got to the product info page yet, that will be the next one to do so I may well need to refer to your previous post!
Thanks again
Jennie
:smile:
Re: Adding manufacturer's logo to products
We must of been zenning ... :cool: