I can’t believe it hasn’t been done yet – that there isn’t a mod out there to add a nice landing page for each manufacturer that you get to from clicking the Manufacturer from the sidebox on a Zen Cart site.
But try as hard as I could I couldn’t find that functionality anywahere – not hidden in the code of Zen Cart or in the forums.
So I thought I’d have a bash at it myself.
Warning the code is very basic – probably lots of room for improvement but for now it seems to be working.
1) Make sure that one or more of the Manufacturers in the Zen Cart Admin has an image associated with it (in my case the image needs to be no wider than 590px or it breaks the design)
2) We are going to be using the Manufacturer URL as the Description field – hey I don’t want to be messing round with the databaase and the 255 chars we can add here will be good as a brief description for the Manufacturer
3) Edit the tpl_index_product_list.php (in templates) and at around line 18 add the following (inside php braces)
Save & Upload this.
What you should find now is that when you go to a page with a manufacturers_id query string it will look in the db to see if there is an associated image and or url (in this case description) and display that
As a final touch you may want to update the Manufacturers page in the Admin section so that the label Manufacturers Url is changed to Description – and that a textarea box is shown rather than the small input field
1) Edit the file admin/manufacturers.php
2) At about line 255 replace this line
$manufacturer_inputs_string .= ‘
‘ . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i][‘directory’] . ‘/images/’ . $languages[$i][‘image’], $languages[$i][‘name’]) . ‘ ‘ . zen_draw_input_field(‘manufacturers_url[‘ . $languages[$i][‘id’] . ‘]’, ”, zen_set_field_length(TABLE_MANUFACTURERS_INFO, ‘manufacturers_url’) );
with this line
$manufacturer_inputs_string .= ‘
‘ . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i][‘directory’] . ‘/images/’ . $languages[$i][‘image’], $languages[$i][‘name’]) . ‘ ‘ . zen_draw_textarea_field(‘manufacturers_url[‘ . $languages[$i][‘id’] . ‘]’, ‘soft’, ’50’, ‘6’,”);
3) Just below that replace
$contents[] = array(‘text’ => ‘
‘ . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
with
$contents[] = array(‘text’ => ‘
Manufacturers Description (max 255 chars)’. $manufacturer_inputs_string);
}
4)A bit further down (line 290 ish) replace
$manufacturer_inputs_string .= ‘
‘ . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i][‘directory’] . ‘/images/’ . $languages[$i][‘image’], $languages[$i][‘name’]) . ‘ ‘ . zen_draw_input_field(‘manufacturers_url[‘ . $languages[$i][‘id’] . ‘]’, zen_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i][‘id’]), zen_set_field_length(TABLE_MANUFACTURERS_INFO, ‘manufacturers_url’));
with
$manufacturer_inputs_string .= ‘
‘ . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i][‘directory’] . ‘/images/’ . $languages[$i][‘image’], $languages[$i][‘name’]) . ‘ ‘ . zen_draw_textarea_field(‘manufacturers_url[‘ . $languages[$i][‘id’] . ‘]’, ‘soft’, ’50’, ‘6’, zen_get_manufacturer_url($mInfo->manufacturers_id, $languages[$i][‘id’]));
}
5) And just below that replace
$contents[] = array(‘text’ => ‘
‘ . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);
with this
$contents[] = array(‘text’ => ‘
Manufacturers Description (max 255 chars)’. $manufacturer_inputs_string);
There you have it a simple way of creating a Manufacturer’s Landing Page in Zen Cart!
See it in action here:
Billabong Landing Page on SurfsideOnline
Comments, suggestions, improvements always welcome though!
Hi Laura,
Thanks for making this available, it's exactly what I'm looking for. Unfortunately I can't get it to work. It's almost certainly my fault. I have copied and pasted the code (from point 3) into the correct file and the result is a blank manufacturer page. The code was copied as follows:
fields['manufacturers_image']))
$content .= '
' . zen_image(DIR_WS_IMAGES . $manufacturer_info_sidebox->fields['manufacturers_image'], $manufacturer_info_sidebox->fields['manufacturers_name']) . '
';
;
if (zen_not_null($manufacturer_info_sidebox->fields['manufacturers_url']))
//$content .= '
# ' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer_info_sidebox->fields['manufacturers_name']) . '
' . "\n" ;
$content .= '
'.$manufacturer_info_sidebox->fields['manufacturers_url'].'
' . "\n" ;
echo $content;
}
}
?>
Can you help please?
Thanks, Peter
Hi Peter,
I've updated the code block at the start – Blogger was messing around with the formatting and it ate up some of my tags – so that might be causing the problems you mention!
Apologies
Laura
Hi Laura,
That's perfect, all working fine.
Many thanks,
Peter
This might be a simple question, where and how would I add CSS for the logo and description of manufacturer? for instance centering the image and changing text color..