Hope someone can help. Seen this code from
http://www.interspire.com/forum/showthr ... and+images
It basically lets you have your popular brands display as image rather than text, works great. However, I would like to know away to exclude certain brands.
I tried
Code: Select all
NOT IN (brandname)
in the file
/includes/display/shopbybrand.php
look for the code
Code: Select all
$x = 1;
while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
if($x <= 10) {
$GLOBALS['BrandLink'] = BrandLink($row['brandname']);
$GLOBALS['BrandName'] = isc_html_escape($row['brandname']);
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandItem");
}
++$x;
}
$GLOBALS['BrandImg'] = "<img src='http://www.yourdomainname.co.uk/images/ ... ges/".$row['brandimagefile']."'>";
so it looks like
Code: Select all
$x = 1;
while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
if($x <= 10) {
$GLOBALS['BrandLink'] = BrandLink($row['brandname']);
$GLOBALS['BrandName'] = isc_html_escape($row['brandname']);
$GLOBALS['BrandImg'] = "<img src='http://www.yourdomainname.co.uk/images/product_images/".$row['brandimagefile']."'>";
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandItem");
}
++$x;
}
Code: Select all
$query = "SELECT brandid, brandname, COUNT(*) AS num
FROM [|PREFIX|]brands b, [|PREFIX|]products p
WHERE p.prodbrandid = b.brandid
AND prodvisible=1
GROUP BY prodbrandid
ORDER BY num DESC, brandname ASC
";
Code: Select all
$query = "SELECT brandimagefile,brandid, brandname, COUNT(*) AS num
FROM [|PREFIX|]brands b, [|PREFIX|]products p
WHERE p.prodbrandid = b.brandid
AND prodvisible=1
GROUP BY prodbrandid
ORDER BY num DESC, brandname ASC
";
templates/_master/snippets/shopbybranditem.html
and edit the line from
Code: Select all
<li><a href="%%GLOBAL_BrandLink%%">%%GLOBAL_BrandName%%</a></li>
Code: Select all
<li><a href="%%GLOBAL_BrandLink%%">%%GLOBAL_BrandImg%%</a></li>