Originally Posted by
perfumbg
I haven't tried it, but I would say that the following should work... I made it based on what I think it should look like to work... There may be some extra information being returned by the select query..
in includes/modules/sideboxes create manlist.php(short for manufacturerlist) and include this code:
PHP Code:
<?php require($template->get_template_dir('tpl_manlist.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes') . '/tpl_manlist.php'); $title = ''; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); ?>
And then:
Then in includes/templates/YOUR_TEMPLATE/sideboxes create tpl_manlist.php and add this:
PHP Code:
<?php
/**
* Product Listing Sidebox by Current Manufacturer
*
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
$prolist_query = "select
products.products_image, products_description.products_name, products_to_categories.*, categories_description.categories_id, categories_description.categories_name,
categories.categories_image, categories.categories_id, manufacturers.*, manufacturers_info.manufacturers_url
from products, products_description, products_to_categories, categories_description, categories, manufacturers, manufacturers_info
where products.manufacturers_id = '$manufacturers_id'
and products.products_id = products_to_categories.products_id
and products_description.products_id = products_to_categories.products_id
and products.manufacturers_id = manufacturers.manufacturers_id
and manufacturers.manufacturers_id = manufacturers_info.manufacturers_id
and products.products_id = products_description.products_id
order by products_description.products_name
";
$prolist = $db->Execute($prolist_query);
if (!$prolist->fields['manufacturers_image'] == null){
$content .= '<div class="manimage">' . zen_image(DIR_WS_IMAGES . $prolist->fields['manufacturers_image'], '<h2>' . $prolist->fields['manufacturers_name'] . '</h2>', 'class="listingManProductImage"') . '</div>';
}else{
$content .= '<h2>' . $prolist->fields['manufacturers_name'] . '</h2>';
}
while (!$prolist->EOF) {
$content .= '<a href="' . zen_href_link(zen_get_info_page($prolist->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $prolist->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $prolist->fields['products_image'], $prolist->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
$prolist->MoveNext();
};
$content .= '</div>';
?>
Bookmarks