Speak to our experts today 0333 004 0333
Speak to one of our experts today
User Guides

EKM Tag: [ekm:customerreviews]

This tag allows you to output customer reviews for the product you are currently viewing. Reviews display with a star rating, customer name and description of the review.

This tag can only be used if the "Customer Reviews" feature has been installed on your EKM shop.

  • Tag Information
  • Nesting This Tag
  • Examples
Basic Use
in it's most basic form the customer reviews tag will output a table layout of all customer reviews for the product you are currently viewing.

[ekm:customerreviews][/ekm:customerreviews]
								
This would output something like...

Customer Reviews
Write an online review and share your thoughts with other shoppers!


Reviewer: John Slater from United Kingdom   5 Stars
Really fast delivery and great product.

Advanced Use
The advanced version of this tag allows you to output customer reviews with custom HTML. This gives you more control over styling and layout.

[ekm:customerreviews]
	show='auto';
	editbuttonposition='right';
	id='auto';

	html_before='<div id="customer-reviews"><h2>Customer Reviews</h2><p><a href="[url]">Write an online review</a> and share your thoughts with other shoppers!</p>';
	html_review='<p>[reviewer]-[location]-[stars]</p><p>[review]</p>';
	html_no_reviews='<p>Be the first to <a href="[url]">review this product</a></p>';
	html_after='</div>';

	limit='10';
	orderby='date ASC';
[/ekm:customerreviews]
								
Tag Attributes
Show?
show='auto'';

Specify whether or not you want the customer review tag to display. This should be left as "auto" typically so that if the feature is uninstalled it will be removed from the website automatically.

Value
Description
auto
Displays the customer reviews if enabled Recommended
yes
Will always show, regardless of whether the feature is installed. Not recommended
no
Will never show the custome reviews, regardless of whether the feature is installed. Not recommended
Edit Button Position
editbuttonposition='inline';

When logged in you will see edit buttons beside the reviews allowing you to remove them. This attribute allows you to specify where those edit buttons will appear.

Value
Description
inline
Will display inline with content
left
Will display to the left of content
right
Will display to the right of content
left bottom
Will display to the bottom-left of content
right bottom
Will display to the bottom-right of content
Product ID
id='auto';

The product review tag can be used throughout your website, this attribute allows you to specify which product's reviews you wish to display. If on the product page you can specify auto which will use the current product's ID.

This attribute can also be set to output all customer reviews on a given shop. This is useful when wanting to have a reviews page where all reviews can be output.

Value
Description
auto
Will display reviews for the currently viewed product
{user defined}
Specify your own product ID and reviews for that product will display.
all
Will display all reviews on an EKM. This is useful when having a webpage which outputs all customer reviews left on a shop.
random
This will get a random review for a random product. This is useful for placing rotating reviews on your website.
HTML Before
html_before='<div id="customer-reviews"><h2>Customer Reviews</h2><p><a href="[url]">Write an online review</a> and share your thoughts with other shoppers!</p>';

This attribute allows you to specify any HTML content you wish to display before the reviews are output. This would typically be a "customer reviews" header and link to allow users to write their own reviews.

Value
Description
{user defined}
Specify your own opening HTML to go before the customer reviews.

This attribute allows you to nest some attribute tags to output review information or links.

Supports conditional tokens.

Value
Description
[url]
Outputs a URL to the "write review" form.
[id]
Outputs the product ID of the product being reviewed. Useful when outputting random products and needing to display the product information.
[average]
Outputs the average star rating for the current product.
[total]
Outputs the total number of reviews for the current product.
Review HTML
html_review='<p>[reviewer]-[location]-[stars]</p><p>[review]</p>';

This attribute allows you to specify any HTML that will be output for each of the customer reviews.

Value
Description
{user defined}
Specify your own opening HTML.

This attribute allows you to nest some attribute tags to output review information.

Value
Description
[reviewer]
Outputs the name of the person reviewing.
[location]
Outputs the geographical location of the person reviewing.
[stars]
Outputs a graphic showing the rating the reviewer gave the product, in stars out of five.
[star-value]
Outputs an integer value of the rating the reviewer gave the product. Useful for outputting your own custom star images or rating graphics.
[review]
Outputs the body of the review
[id]
Outputs the product ID of the product being reviewed. Useful when outputting random products and needing to display the product information.
No Reviews HTML
html_no_reviews='<p>Be the first to <a href="[url]">review this product</a></p>';

This attribute allows you to specify any HTML content you wish to display if there are no reviews to display. This would typically be a message asking for customers to leave a review.

Value
Description
{user defined}
Specify your own opening HTML to go before the customer reviews.

This attribute allows you to nest some attribute tags to output review information or links.

Value
Description
[url]
Outputs a URL to the "write review" form.
[id]
Outputs the product ID of the product being reviewed. Useful when outputting random products and needing to display the product information.
HTML After
html_after='</div>';

This attribute allows you to specify any HTML content you wish to display after the reviews are output. This would typically any closing tags to any HTML opened in html_before

Value
Description
{user defined}
Specify your own opening HTML to go before the customer reviews.

This attribute allows you to nest some attribute tags to output review information or links.

Value
Description
[url]
Outputs a URL to the "write review" form.
[id]
Outputs the product ID of the product being reviewed. Useful when outputting random products and needing to display the product information.
Limit
limit='10';

Specify the number of reviews you would like to display on this page.

Value
Description
{user defined}
Specify an integer value for the maximum number of reviews you wish to display.
Order By
orderby='rating DESC, date DESC';

Specify the order in which you wish your reviews to display. This could be useful if you wanted only positive reviews to appear first.

Value
Description
date ASC
Display reviews ordered by date in ascending orders.
date DESC
Display reviews ordered by date in descending orders.
rating ASC
Display reviews ordered by rating in ascending orders.
rating DESC
Display reviews ordered by rating in descending orders.
Include Rich Snippet
include_rich_snippet='no';

Sets whether the tag will output with rich snippets or not. By default they will output.

It is recommended that you only turn off rich snippets when you use this tag more than once on a page.

Value
Description
yes
Outputs the reviews with rich snippets.
no
Outputs the reviews without rich snippets.
New Line Replace
newline_replace='<br/>';

Outputs when there is a new line in a review's content.

Value
Description
{user defined}
Specify HTML you want to use to create a new line.

The EKM system allows for some tags to be nested within other tags.

Nesting This Tag

When nesting this tag you do need to ensure the start and end of the tag are prefixed with nested_ and that all single quotes ' are replaced with " double quotes.


[ekm:showdata]
	...
	data='products';
	location='auto';
	output_item='
		[ekm:nested_customerreviews]
			show="auto";
			editbuttonposition="right";
			id="[id]";

			html_before="";
			html_review="<p>[reviewer]-[location]-[stars]</p><p>[review]</p>";
			html_no_reviews="";
			html_after="";

			limit="10";
			orderby="date ASC";
		[/ekm:nested_customerreviews]
	';
	...
[/ekm:showdata]
								

Customer Reviews Page

It may be useful for you to have a customer reviews page on your website. Perhaps you want to show a long list of reviews for products on one page, perhaps you want to call this a customer "testimonials" page.

In this example you can output all the reviews for all the products within a category.


<style type="text/css">
	.ib {display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; vertical-align: middle;}
	#reviews-header {font-size: 16px; font-weight: bold; margin: 0 0 10px; color: #0082ad; padding: 10px 0;}
	#customer-reviews {}
	#customer-reviews .item {}
	#customer-reviews .item-name {font-size: 14px; font-weight: bold; margin: 0 0 5px;}
	#customer-reviews .item-name a {text-decoration: none;}
	#customer-reviews .item-image {width: 140px; border: 1px solid #efefef; border-radius: 3px;}
	#customer-reviews .item-info {width: 560px; margin: 0 0 0 20px; font-size: 11px;}
	#customer-reviews .item-price {margin: 5px 0 0; font-size: 14px; font-weight: bold; color: #ad0062;}

	#customer-reviews .item-reviews {margin: 0 0 0 70px; padding: 10px 10px 30px; border-left: solid 3px #efefef;}
	#customer-reviews .item-review {margin: 5px 10px; background: #f4f4f4; border-radius: 3px; border: solid 1px #e7e7e7; padding: 10px; font-size: 11px; color: #666;}
	#customer-reviews .item-review-text {font-size: 12px; font-style: italic; color: #111;}
	#customer-reviews .item-review-info {margin: 10px 0 0;}
	#customer-reviews .item-review-info .text {line-height: 20px; margin: 0 10px 0 0;}
	#customer-reviews .item-review-info .stars {padding: 0 0 1px;}
</style>

[ekm:showdata]

	data='products';
	location='58';

	cols='1';
	rows='999';
	page_navigation='auto';

	orderby='orderlocation, name';
	skiprecords='0';
	excludelist='';
	includelist='';

	editbuttons='YES';
	counterreset='4';

	image_ratio='140';
	image_width='auto';
	image_height='auto';

	font_formatting='no';

	output_start='<div id="customer-reviews"><div id="reviews-header">Customer Reviews</div>';
	output_row_start='<div class="row cf">';
	output_column_start='';
	output_item='
	<div class="item i-[counter]">
		<div class="item-image ib">[image]</div>
		<div class="item-info ib">
			<div class="item-name">[name]</div>
			<div class="item-short-description">[shortdescription]</div>
			<div class="item-price">[price]</div>
			<div class="item-rrp">[rrp]</div>
		</div>
		[ekm:nested_customerreviews]
			show="auto";
			editbuttonposition="right";
			id="[id]";

			html_before="<div class="item-reviews">";
			html_review="
			<div class="item-review">
				<div class="item-review-text">[review]</div>
				<div class="item-review-info"><span class="ib text">Left By [reviewer] from [location]</span><span class="ib stars">[stars]<span></div>
			</div>
			";
			html_no_reviews="";
			html_after="</div><!-- .item-reviews -->";

			limit="5";
			orderby="rating DESC";
		[/ekm:nested_customerreviews]
	</div><!-- .item -->
	';
	output_column_end='';
	output_row_end='</div><!-- .row -->';
	output_end='</div><!-- #products -->';

	' Element Replace
	element_replace='null';

[/ekm:showdata]
								
This outputs the following.