Customer Reviews Count

How can we add the count of Customer Reviews on a Product Page? Currently if a Review exists it will be in the Review tab.

Ex :http://indiangrocery.com/7421/Grand-Sweets-Manoharam-250g/

Users generally don’t click on the Review Tab unless we say there are some Reviews available like showing a count of Reviews. Ex : Reviews(2) or Reviews(3) like that.

How can we show that count in the Tab Header?

Thanks
Shri

Hi Shri,

Since the data isn’t available outside of the reviews panel, the easiest way would be write it out as a JS variable and then use that onload to populate the tab’s label.

Say your heading DIV has ID ‘reviews-heading’. You can add this script tag to the reviews panel:

<script>var nReviewCount = {reviewsummary['ratingcount']};</script>

This goes just below the {ifThereAre reviews} tag.

Then in the footer, on load:

$(function() { if (nReviewCount !== undefined) { $('reviews-heading').text('Customer Reviews ('+nReviewCount+')') } } )

I haven’t tested this code so it might not be perfect. I guess you get the general idea.

Regards,
Donogh

Donogh, just need some quick clarification.

Add the below code to Reviews Panel

Where should we add the function?
$(function() { if (nReviewCount !== undefined) { $(‘reviews-heading’).text(‘Customer Reviews (’+nReviewCount+‘)’) } } )

You said to add it in the footer. Do u mean the main Footer Template? Don’t we need to add anything on the Product Page as that is where we show the Reviews?

Thanks
Shri

Hi Balmoori,

We recently added new tags that will allow you to show the quantity and the average rating in any place of the product page.

If you are using the reviews coming from the customers, these are the variables:
product['product_rating_customer'] and product['product_rating_count']

If you have products using the PAM reviews and the customers reviews, this is the code you need to use:

   {if (product['product_rating_count'] ne 0)}
    Review: {product['product_rating_customer']} / 5 ({product['product_rating_count']} votes)
   {elseIf (product['product_rating'] ne 0)}
    Review: {product['product_rating']} / 5
   {endIf}

You can use the same image you use in the review panel if you prefer it.
Best regards,
Belén

Thanks a lot Belen. Works like a charm. This will be very useful for Customers.
Thanks Again.
Shri

1 Like