hi david.
Is is possible to setup the merchant links to list all categories and brands under a specific merchant.
Thanks in advance.
Hi Alex,
Sure - to display the lists at the top, look for the following code towards the end of search.php:
require("html/banner.php");
...and REPLACE this with:
require("html/banner.php");
if ($parts[0]=="merchant")
{
$sql = "SELECT DISTINCT(category) AS category
FROM `".$config_databaseTablePrefix."products`
WHERE merchant='".database_safe($parts[1])."'";
database_querySelect($sql,$categories);
$sql = "SELECT DISTINCT(brand) AS brand
FROM `".$config_databaseTablePrefix."products`
WHERE merchant='".database_safe($parts[1])."'";
database_querySelect($sql,$brands);
print "<table>";
print "<tr>";
print "<td valign='top'>";
if (is_array($categories))
{
print "<h4>Categories</h4>";
print "<ul>";
foreach($categories as $row)
{
if ($config_useRewrite)
{
$href = $config_baseHREF."category/".tapestry_hyphenate($row["category"])."/";
}
else
{
$href = $config_baseHREF."search.php?q=category:".urlencode($row["category"]);
}
print "<li><a href='".$href."'>".$row["category"]."</a></li>";
}
print "</ul>";
}
print "</td>";
print "<td valign='top'>";
if (is_array($brands))
{
print "<h4>Brands</h4>";
print "<ul>";
foreach($brands as $row)
{
if ($config_useRewrite)
{
$href = $config_baseHREF."brand/".tapestry_hyphenate($row["brand"])."/";
}
else
{
$href = $config_baseHREF."search.php?q=brand:".urlencode($row["brand"]);
}
print "<li><a href='".$href."'>".$row["brand"]."</a></li>";
}
print "</ul>";
}
print "</td>";
print "</tr>";
print "</table>";
}
Cheers!
David.
Hi Alex,
Just to confirm, do you mean on the merchant search results (having clicked a merchant from the Merchant A-Z) you want to show all categories and brands for that merchant as well as the search results?
Cheers,
David.