Hi David,
How can i display the category in search results for each product listed.
thanks
jack
Hello David,
I got a blank results but the banner did show the total products.
How to solve it.
thanks
jack
Hello Jack,
This modification should not have changed the existing appearance at all - could you email me your modified html/searchresults.php and i'll check it over for you...
Cheers,
David.
Hello David,
I got error message as below
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xxxx/public_html/xxxxx/html/searchresults.php on line 26
thanks
jack
Hi,
Could you email the file to me again and i'll check it out for you...
Cheers,
David.
Hi David,
I got it working. Very inspiring. I added merchant and brand as well. Thank you very much.
Wonder if i can include review as well. Is the same just change to review in the script.
thanks
jack
Hello Jack,
Very similar - try this code for a review link:
if ($config_useRewrite)
{
$href = $config_baseHREF."review/".tapestry_hyphenate($product["name"])."/";
}
else
{
$href = $config_baseHREF."reviews.php?q=".urlencode($product["name"]);
}
print "<p><a href='".$href."'>Review This Product</a></p>";
Cheers,
David.
Hi David,
The review product doesn't work. When click it goes back to main page. How to get it right.
thanks
jack
Hello David,
Is this corrent to include the rating.How can i make it to look like Rating: ***** or if there is no rating, then it diplay Rating: None or just blank.
<?php
if ($product["rating"]) print tapestry_stars($product["rating"],"");
?>
thanks
jack
Hello Jack,
That code is fine wherever the $product variable contains a product record (like in the main loop in html/searchresults.php.
To display "None" if there is no rating; use:
<?php
if ($product["rating"])
{
print tapestry_stars($product["rating"],"");
}
else
{
print "None";
}
?>
Cheers,
David.
Hi David,
Thanks. I added the .html to the below scripts and i working now
<?php
if ($config_useRewrite)
{
$href = $config_baseHREF."review/".tapestry_hyphenate($product["name"]).".html";
}
else
{
$href = $config_baseHREF."reviews.php?q=".urlencode($product["name"]).".html";
}
print "<p>Product Review: <a href='".$href."'>Add Review</a></p>";
?>
<?php
print translate("Ratings: ");
?>
<?php
if ($product["rating"])
{
print tapestry_stars($product["rating"],"");
}
else
{
print "None";
}
?>
I am trying to get the output look like below but couldn't figure out. Unsuccessful.
Product review: Read Reviews (2)| Add Reviews | Rating: **
How can i get the output like the above.
thanks
jack
Hello Jack,
It will be the P tags separating everything. Try something like this:
<?php
print "<p>";
print "Product review: ";
if ($config_useRewrite)
{
$href = $config_baseHREF."review/".tapestry_hyphenate($product["name"]).".html";
}
else
{
$href = $config_baseHREF."reviews.php?q=".urlencode($product["name"]).".html";
}
print "<a href='".$href."'>Read Reviews</a> (".$product["reviews"].")";
print " | ";
print "<a href='".$href."'>Add Reviews</a>";
print " | ";
print "Rating: ";
if ($product["rating"])
{
print tapestry_stars($product["rating"],"");
}
else
{
print "None";
}
print "</p>";
?>
Cheers,
David.
Hello David,
Works fine. Thank you so much.
cheers,
jack
Hello Jack,
Within the main loop within html/searchresults.php, the category will be in the variable $product["category"]; so you could display this as a link to that category's search results after the description by replacing the following code (line 20):
<p><?php print substr($product["description"],0,250); ?></p>
With:
<p><?php print substr($product["description"],0,250); ?></p>
<?php
if ($config_useRewrite)
{
$href = $config_baseHREF."category/".tapestry_hyphenate(".$product["category"].")."/";
}
else
{
$href = $config_baseHREF."search.php?q=category:".urlencode($product["category"]).":";
}
print "<p>Category: <a href='".$href."'>".$product["category"]."</a></p>";
?>
Cheers,
David.