View Single Post
  #32  
Old 05-15-2005, 04:59 PM
 
dmr8448 dmr8448 is offline
 

Senior Member
  
Join Date: Jun 2003
Posts: 123
 

Default Manfacturer Name and Link in Products List

I am trying to get the manfucturer name to display on the products listing page. I have done the following:

==========================================

Make a new function in func.php
Code:
function func_get_manufacturers($manufacturerid) {
global $sql_tbl;

return func_query("SELECT $sql_tbl[manufacturers].* FROM $sql_tbl[manufacturers] WHERE manufacturerid='$manufacturerid'");
}


In products.php
Code:
if ($products) {
foreach ($products as $k => $v)
$manufacturers[] = func_get_manufacturers($v["manufacturerid"]);
}

$smarty->assign("manufacturers", $manufacturers);


In products.tpl just use
Code:
{*** ########## Lines below to display manufacture name ########## ***}
{assign var="manid" value=$products[product].manufacturerid}
{if $manufacturers[$manid].manufacturerid ne "0"}
<FONT class="ItemsList">{$manufacturers[$manid].manufacturer}</FONT>

{/if}
{*** ########## End display manufacture name ########## ***}

==========================================

The problem I am having is the the link shows the incorrect manufacturer name, but when I click on the link it takes me to the correct manufacturer page.

Thanks
David

X-Cart version 4.0.12
PHP 4.3.10
MySQL server 4.0.23-nt-max
MySQL client 3.23.49
Web server Microsoft-IIS/6.0
Operation system Windows
XML parser (expat) 1.95.6
Reply With Quote