Hi,
Somehow the products aren't showing on the frontpage. I use the random products function.
<?php
require("includes/common.php");
$header["meta"]["description"] = $config_metaDescriptionIndex;
$header["meta"]["keywords"] = $config_metaKeywordsIndex;
require("html/header.php");
require("html/searchform.php");
//print javascript_focus("search.q");
$featuredproducts_merchantRandom = "Nationale-Vacaturebank";
require("featuredproducts.php");
$featuredproducts_categoryRandom = "Productie-Uitvoerend";
require("featuredproducts.php");
$featuredproducts_categoryRandom = "Gezondheid-Paramedisch-Zorg";
require("featuredproducts.php");
$featuredproducts_categoryRandom = "Administratief-Boekhouding";
require("featuredproducts.php");
$featuredproducts_categoryRandom = "Onderwijs-Onderzoek-Wetenschap";
require("featuredproducts.php");
$featuredproducts_categoryRandom = "Commercieel-Verkoop";
require("featuredproducts.php");
$featuredproducts_categoryRandom = "Beveiliging-Veiligheid";
require("featuredproducts.php");
require("html/footer.php");
?>
Thanks.
I hyphenated the merchants / categories are hyphenated instead of using actually the
exact merchant / category names as they appear on the A-Z lists. Now it works.
Hi,
I noticed the featuredproducts.php is only showing 'products' from one merchant. Is there a way it selects/random more merchants to show?
In my featuredproducts.php I have:
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE merchant = '".$featuredproducts_merchantRandom."' AND price >= 0 AND price <= 999.00 ORDER BY RAND() LIMIT 3";
}
elseif ($featuredproducts_categoryRandom)
{
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE category = '".$featuredproducts_categoryRandom."' ORDER BY merchant LIMIT 3";
}
else
{
$sql = "SELECT * FROM `".$config_databaseTablePrefix."featured` WHERE name LIKE '".$featuredproducts_category."/%' ORDER BY merchant";
Hi Marco,
It looks like the code only has a merchantRandom version in place. If you wanted to add an all merchants random, replace that section (and the enclosing IF statement) with:
if ($featuredproducts_random)
{
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE price >= 0 AND price <= 999.00 ORDER BY RAND() LIMIT 3";
$featuredproducts_random = FALSE;
}
elseif ($featuredproducts_merchantRandom)
{
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE merchant = '".$featuredproducts_merchantRandom."' AND price >= 0 AND price <= 999.00 ORDER BY RAND() LIMIT 3";
}
elseif ($featuredproducts_categoryRandom)
{
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE category = '".$featuredproducts_categoryRandom."' ORDER BY merchant LIMIT 3";
}
else
{
$sql = "SELECT * FROM `".$config_databaseTablePrefix."featured` WHERE name LIKE '".$featuredproducts_category."/%' ORDER BY merchant";
}
...and then in your calling code, use:
$featuredproducts_random = TRUE;
require("featuredproducts.php");
Cheers,
David.
--
PriceTapestry.com
Hi Marco,
If you would like to forward your new version of featuredproducts.php and include your new calling code in the email I'll check it out for you...
Cheers,
David.
--
PriceTapestry.com
Hi Marco,
That all looks fine - please could you email me your featuredproducts.php script and I'll check it out further...
Cheers,
David.
--
PriceTapestry.com