View Single Post
  #4  
Old 04-04-2007, 12:53 PM
 
micromedia micromedia is offline
 

Member
  
Join Date: Feb 2005
Posts: 27
 

Default Re: More Effective Manufacturer view on Product Detail Page

Quote:
Originally Posted by anandat
Very nice mod micromedia...thanks a lot for sharing

Is there anyway I we can add number of products just after the name of manufacturer in same page ?

For example:
manufacturer XYZ <112 products) SEE ALL Products


I guess it's possible since in admin it shows how many product every manufacturer has but I can't figuer out what excatly require to change to display number of products .

I hope some x-cart guru here will help us.

Ok anadat.

lets add those code:

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); $totalmanuprod = "SELECT COUNT(*) FROM $sql_tbl[products] WHERE $sql_tbl[products].forsale='Y' AND $sql_tbl[products].avail > 0 AND $sql_tbl[products].manufacturerid = '$product_info[manufacturerid]' " ; $totalmanuprods = func_query_first_cell($totalmanuprod); $smarty->assign("totalmanuprods",$totalmanuprods); ?>
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> ( {$totalmanuprods} products)<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}&amp;cat={$cat}&amp;manufacturerinfo"> <font class="ProductTitle">{$manufacturerinfo.product}</font></a><br /> <a href="product.php?productid={$manufacturerinfo.productid}&amp;cat={$cat}&amp;manufacturerinfo"> {include file="product_thumbnail.tpl" image_x=75 productid=$manufacturerinfo.productid product=$manufacturerinfo.product} </a><br /> <font class="ProductPrice"> Our Price:&nbsp; {include file="currency.tpl" value=$manufacturerinfo.price}</font><br /> {if $manufacturerinfo.list_price gt 0} <font class="MarketPrice"> Market Price:&nbsp;<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}

It will be work. it shows number of product next to manufacturer name
like : manufacturer xyz (23 products)
__________________
X Cart Gold Ver. 4.1.6
Reply With Quote