This is more effective manufatucrer modul for product detail page. It is working on x-cart gold 4.1.6
manufacturer image,
manufacturer name,
link on this manufacturer page,
random 5 products from manufacturer with image, price, name
Create
modules/Manufacturers/manufacturerinfo.php
Code:
<?
if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); }
$query = "SELECT $sql_tbl[products].productid, $sql_tbl[products].product, $sql_tbl[products].descr, $sql_tbl[pricing].price FROM $sql_tbl[products],$sql_tbl[pricing] WHERE $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].productid = $sql_tbl[pricing].productid AND $sql_tbl[products].manufacturerid = '$product_info[manufacturerid]' ORDER BY RAND() LIMIT 5" ;
$manufacturerinfos = func_query($query);
$smarty->assign("manufacturerinfos",$manufacturerinfos);
?>
Create
modules/Manufacturers/manufacturerinfo.tpl
Code:
{* $Id: manufacturerinfo.tpl,v 1.8.2.1 2007/03/19 13:12:29 max Exp $ *}
{if $product.manufacturer ne ""}
{if $manufacturerinfos}
{capture name=dialog }
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" style="padding:5px;" valign="top"><a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><img src="image.php?id={$product.manufacturerid}&type=M " alt="{$manufacturer}" border="0" /></a></td>
<td align="left" style="padding:5px;" valign="top" width="100%"><a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><b>{$product.manufacturer}</b></a><br />
{$product.manudescr|truncate:250:"...":true} <br />
<br />
<a href="manufacturers.php?manufacturerid={$product.manufacturerid}"><u>See All Products</u></a></td>
</tr>
</table>
<hr/>
<table width="100%" cellpadding="0" cellspacing="0">
<tr > {foreach from=$manufacturerinfos item=manufacturerinfo }
<td width="20%" valign="top"><div style="border:1px solid #ccc;padding:5px;margin:5px; text-align:center"> <a href="product.php?productid={$manufacturerinfo.productid}&cat={$cat}&manufacturerinfo"> <font class="ProductTitle">{$manufacturerinfo.product}</font></a><br />
<a href="product.php?productid={$manufacturerinfo.productid}&cat={$cat}&manufacturerinfo"> {include file="product_thumbnail.tpl" image_x=75 productid=$manufacturerinfo.productid product=$manufacturerinfo.product} </a><br />
<font class="ProductPrice"> Our Price: {include file="currency.tpl" value=$manufacturerinfo.price}</font><br />
{if $manufacturerinfo.list_price gt 0} <font class="MarketPrice"> Market Price: <s>{include file="currency.tpl" value=$manufacturerinfo.list_price}</s> </font> <br />
{/if}
<font size="1"> {$manufacturerinfo.descr|truncate:50:"...":true}</font><br />
</div></td>
{/foreach} </tr>
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.dialog extra='width="100%"'}
{/if}
{/if}
EDIT product.php
After:
Code:
if ($active_modules["Manufacturers"])
include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php";
Add
Code:
if ($active_modules["Manufacturers"])
include $xcart_dir."/modules/Manufacturers/manufacturerinfo.php";
EDIT skin1/customer/main/product.tpl
Add
Code:
{include file="modules/Manufacturers/manufacturerinfo.tpl" }