Hi David
I'm looking to strip out most of the content from the search results pages, so that they just list the product name and the header info.
In other words could you please let me know how to remove the photos, prices and more information links?
I've tried scouring the code for clues about where this gets populated from but couldn't work it out.
Thanks very much
Oliver
Hi David
Thanks - I tried the second piece of code but I get this error:
Parse error: syntax error, unexpected T_ELSE in /var/www/vhosts/MYURLHERE.com/PATH/PATH/search.php on line 7
I wonder if you could check that code is correct or am I missing something out?
Thanks
Oliver
Hi Oliver,
I'm slightly confused by the error message as presumably you made the changes down at the bottom of search.php, nowhere near line 7...!
Feel free to email me your modified search.php (reply to your forum registration or reg code email) and i'll take a look if you like...
Cheers,
David.
Hello Oliver,
It's probably easiest to write the code you want to display the results from scratch rather than cut down the current version as generated by html/searchresults.php
That file is included by search.php with the following code (look near the bottom):
require("html/searchresults.php");
At that point, you could replace that code with the following PHP if you just want a list of products, nothing more:
foreach($searchresults["products"] as $product)
{
print "<p>".$product["name"]."</p>";
}
If you want the product name linked to the product page, it's just slightly more code as follows:
foreach($searchresults["products"] as $product)
{
print "<p><a href='".$product["href"]."'>".$product["name"]."</a></p>";
}
Hope this helps!
Cheers,
David.