You are here:  » Count review's and link to review page in related products

Support Forum



Count review's and link to review page in related products

Submitted by mediacode on Thu, 2012-01-26 22:13 in

Hello David,

I try to figure out how I can realize a review-link into related products on the product-detail-page that also counts reviews from related product. I posted the Screenshot for better understanding.
I uploaded here: {link saved}

It would be pretty to solve this.
Thanks in advance.

Almir

Submitted by support on Fri, 2012-01-27 09:46

Hello Almir,

Sure - related products HTML is actually generated by the searchresults HTML module (html/searchresults.php to the following instructions would relate to both but of you don't require the review link on search result pages that can be fixed easily. In your file, look for where the description is displayed, similar to the following code from the distribution version:

<p><?php print tapestry_substr($product["description"],250,"..."); ?></p>

...and immediately after this point; add the following code to generate your review link:

if ($product["reviews"])
{
  $reviewHTML = "<p>".tapestry_stars($product["rating"],"")."&nbsp;<a href='".tapestry_reviewHREF($product)."'>".$product["reviews"]." ".translate("Reviews")."</a></p>";
}
else
{
  $reviewHTML = "<p><a href='".tapestry_reviewHREF($product)."'>".translate("Review This Product")."</a></p>";
}
print $reviewHTML;

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by mediacode on Fri, 2012-01-27 12:27

Hello David,

thank you for providing the solution. The only thing I need is the Counter as many reviews stored on the product are.
Similar on the detail page (as x Reviews) below the price.

Best regards, Almir.

Submitted by support on Fri, 2012-01-27 12:34

Hello Almir,

The count should be displayed; but only where there is at least 1 review. The above code should display

3 Reviews
or
Review This Product

(exactly as the product page)

If that doesn't seem to be the case after testing against a product that definitely has reviews (don't forget to moderate them in from /admin/ if testing), if you could post your full html/searchresults.php I'll check it out...

Cheers,
David.
--
PriceTapestry.com

Submitted by mediacode on Fri, 2012-01-27 13:24

Yeah man, you're right!
I was blind to this part!!

Thanks & Best regards!
Almir