Ecommerce Templates > General Help > The Control Panel > Product reviews and ratings

Product reviews and ratings

Product reviews are a great way of providing on-topic content, useful to both customers and search engines alike. As they are provided by visitors and reviewed by the store owner before publishing you can be guaranteed fresh and relevant copy for your store.

Version 5.5.0 saw the addition of product reviews and ratings to Ecommerce Templates and the set up details are outlined below.

Enabling product reviews and ratings

To enable the review and rating feature you will need to add one line to vsadmin/includes.asp or vsadmin/includes.php depending on the version of the store you are running.

ASP Version: enablecustomerratings=TRUE
PHP Version: $enablecustomerratings=TRUE;

You can now visit any of your product detail pages and you should see something like this

Product reviews

Clicking on the link will allow your customers to give the product a rating and a review

Product review

All customer reviews are sent to the store control panel for approval before publication. This allows you to weed out any unwanted additions if you need to. Constructive criticism of a product may not be such a bad thing and glowing reports on everything on the store may appear quite contrived so it's good to achieve a balance.

Product review

New reviews will appear in red in your ratings admin page, and this is where you can view, approve or delete the review. On approval the review will be sent to your product detail page.

Product review

You can specify the number of product reviews you want to appear on the product detail page with the a one line addition to vsadmin/includes.asp or vsadmin/includes.php

ASP Version: numcustomerratings=2
PHP Version: $numcustomerratings=2;

Clicking on the "Show All" link will take you to the main product review page.

Product review

The customer can sort the reviews by rating or date submitted. You can specify the number of reviews you want per page on the main ratings listing with this line in vsadmin/includes.asp or vsadmin/includes.php

ASP Version: allreviewspagesize=30
PHP Version: $allreviewspagesize = 30;

You can restrict the product review feature to logged in customers only. All users will be able to see the reviews and ratings but only those who are logged into your site will be allowed to submit a review or rating. To activate this feature you will need to add a line to vsadmin/includes.asp or vsadmin/includes.php

ASP Version: onlyclientratings=TRUE
PHP Version: $onlyclientratings=TRUE;

Product review tweaks

Define the number of characters shown in the review

The default number of characters before the text is truncated is 255 on the product detail page. If you want to show more of the text there then you will need the following settings for example

in vsadmin/includes.asp
customerratinglength=1024

or in vsadmin/includes.php
$customerratinglength=1024;

Limit reviews per day

It is possible to limit the number of reviews allowed in a 24 hour period with this addition to vsadmin/includes.asp or vsadmin/includes.php

ASP Version: dailyratinglimit=10
PHP Version: $dailyratinglimit=10;

Change the ratings graphics

The default graphics are shown in the screenshot above but we have some extra sets of graphics on our downloads page that you can upload to your main images folder.

You can make your own graphics. You will need three and they should be called reviewcart.gif, reviewcarthg and reviewcartg.gif for the full image, half image and dimmed image.

Change the separator between reviews

If you want to use a cross browser horizontal line color between the product reviews then add this to you .css file

hr.review {
height: 0;
border-width: 1px 0 0 0;
border-style: dashed;
border-color: #006AC8;
}

This will give you a blue dashed line like the one below

Add the ratings to the product page

From version 5.6.0 it is possible to add the ratings to the products page along with a link that will take you to the reviews on the product detail page

Product review

To enable this feature you will need a minimum version of 5.6.0 and the following:

in vsadmin/includes.asp
ratingsonproductspage=TRUE

or in vsadmin/includes.php
$ratingsonproductspage=TRUE;

If you would like to show the ratings and stars away from the reviews section such as under the product name you will need to be using the css layout with reviewstars or reviewstarslarge and then add the following...

...in vsadmin/includes.asp
detailreviewstarstext='<a href="#reviews">Rating: %totrating%, based on:%numratings%</a>'

...in vsadmin/includes.php
$detailreviewstarstext='<a href="#reviews">Rating: %totrating%, based on:%numratings%</a>';


...where you can enter your own free form text with the replacements for %totrating% and %numratings%

If you want to show content when there are no reviews or ratings add this...

...in vsadmin/includes.asp
detailreviewnoratings='<div class="detailnoratings">Whatever You like</div>'

...in vsadmin/includes.php
$detailreviewnoratings='<div class="detailnoratings">Whatever You like</div>';

...to show the content of your choice.

If you are using the multiple language feature you can specify which languages should show in the reviews with the following addition to vsadmin/includes.asp

ratingslanguages="0,1,2,3,4"

or in vsadmin/includes.php

$ratingslanguages='0,1,2,3,4';

This sets the store to show the ratings using the language id's in the parameter.


Back to top