Submitted by rolli1 on Sat, 2006-12-30 20:40 in Price Tapestry
Hi David,
When I execute a search with PT a results page appears with ( in my case ) 10 products showing. How can I manage that in the head of this page the meta keywords tag contains the name of these 10 products?
Hello Roland,
This can be done quite easily. In search.php, find the loop that goes through the search results...(line 138)
foreach($searchresults["products"] as $k => $product)
{
Now, add on the next line (indented with the loop) the following code to build up an array of product names)
$productNames[] = $product["name"];
Finally, add the following code:
if (is_array($productNames))
{
$header["meta"]["keywords"] = implode(",",$productNames);
}
...just before the following line:
require("html/header.php");
That should do the trick...
Cheers,
David.