Product Reviews
Product Reviews
We need to ensure that reviews are given the proper space on the page so that customers are able to write long enough replies and other customers can properly read them. As it stands they are assigned as an afterthought, rather than being properly considered.
Features
-
Whether or not you have to be logged in to write a review
-
Ability to choose more specific reasons for your rating (i.e. 5/5 for Price, 3/5 for Quality). This includes being able to enter text reasons as well
-
View overall product rating based
-
Ability to rate whether the review was helpful or not
Customer Input
-
Review title
-
E-mail address
-
Review
-
Customer name
Code Examples
Overview
{if $product.total_reviews > '0' AND $average_review_scores}
{foreach from = $product_review_ratings item=review_rating key=review_rating_key}
<div class="reviews_top">
<span class="ratingtitle">{$review_rating}</span>
<ul class="stars">
{$average_review_scores.$review_rating_key|productStarRating:"/templates/`$templates_dir`/_images/icons/star_small"}
</ul>
<div class="clear"></div>
</div>
{/foreach}
{/if}
Write a Review
<a href="/products/reviews?product_id={$product.id}" class="writereview" rel="nofollow">
<img src="/templates/{$templates_dir}/_images/buttons/writeareview.gif" alt="Write a Review" class="rollover" />
</a>
Display Reviews
{if $product_reviews}
{foreach from = $product_reviews item=review name=reviews}
<li id="reviewid{$review.id}"{if $smarty.foreach.reviews.iteration > '4'} style="display: none;"{/if}>
<div class="reviews_box">
<p class="title">{$review.review_title}</p>
{foreach from = $product_review_ratings item=review_rating key=review_rating_key}
<span class="ratingtitle">{$review_rating}</span>
<ul class="stars">
{$review.ratings.$review_rating_key|productStarRating:"/templates/`$templates_dir`/_images/icons/star_small"}
</ul>
{/foreach}
<p>{$review.review_description|escape:"html":"UTF-8"|nl2br}</p>
<p class="author">- {$review.reviewer_name} {if $review.reviewer_location} from {$reviewer_location}{/if} on {$review.date_created|strtotime|date:"jS M, Y"}</p>
{if $review.user_ratings.total_ratings > 0}
<p>
<span class="user_ratings">{$review.user_ratings.total_positive} of {$review.user_ratings.total_ratings} {$review.user_ratings.peopleOrPerson}</span> found the following revi
ew helpful.</p>
{/if}
<p class="lighttext">Did you find this review helpful?</p><br />
<p class="buttons">
<a href="" title=""><img src="/templates/{$templates_dir}/_images/buttons/yes.gif" alt="Review Helpful" /></a>
<a href="" title=""><img src="/templates/{$templates_dir}/_images/buttons/no.gif" alt="Review Not Helpful" /></a></p>
{*
* Give feedback to the customer as to whether they rated it negative or positive
*}
<div class="reviewhelpfulfeedback">
</div>
</div>
</li>
{/foreach}
</ul>
{else}
<div class="infobox">
<h2>There are currently no reviews.<br />Please help us and other users by writing a review.</h2>
</div>
{/if}
Additional paging and sorting functionality for reviews is available via Ajax Product getReviews
Updated about 1 year ago