Quote:
Originally Posted by dmr8448
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.
|
Just a summary of things we did to show manufacturer name in the list of products (thanks to pmstudios and jds580s)
add to include/func.php
Code:
#
# Function to get manufacturers into product list
#
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
before this line:
Code:
$smarty->assign("products",$products);
add
Code:
#
# Get products manufacturers
#
if ($products) {
foreach ($products as $k => $v)
$manufacturers[] = func_get_manufacturers($v["manufacturerid"]);
}
$smarty->assign("manufacturers", $manufacturers);
#
# Get products manufacturers
in customer/main/products.tpl or customer/main/products_t.tpl:
after
Code:
<FONT class="ProductTitle">{$products[product].product}</FONT></A>
add
Code:
{* show Manufacturer name *}
<FONT class="sitesmall">Manufacturer:
{assign var="manid" value=$products[product].manufacturerid}
{if $manufacturers[$manid].manufacturerid ne "0"}
{$manufacturers[$manid].manufacturer}
{/if}
{* show Manufacturer name *}
Example is here:
http://www.reach4life.com/store/home.php?cat=554