Jump to content

How can i edit productcomments_reviews-tpl to show all ratings?


Recommended Posts

Hi

 

In the file productcomments_reviews.tpl it only shows average rating for the product with one single set of stars, despite that i have configured in the review module the sets "Design", "Performance" and "Build Quality".

 

I feel really stuck how i can edit this code to actually cycle through all the sets i have setup in the rating/Review:

{if isset($nbComments) && $nbComments > 0}
	<div class="comments_note" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
		<div class="star_content clearfix">
			{section name="i" start=0 loop=5 step=1}
				{if $averageTotal le $smarty.section.i.index}
					<div class="star"></div>
				{else}
					<div class="star star_on"></div>
				{/if}
			{/section}
            <meta itemprop="worstRating" content = "0" />
            <meta itemprop="ratingValue" content = "{if isset($ratings.avg)}{$ratings.avg|round:1|escape:'html':'UTF-8'}{else}{$averageTotal|round:1|escape:'html':'UTF-8'}{/if}" />
            <meta itemprop="bestRating" content = "5" />
		</div>
		<span class="nb-comments"><span itemprop="reviewCount">{$nbComments}</span> {l s='Review(s)' mod='productcomments'}</span>
	</div>
{/if}

All i need is for the ratings built-in Prestashop not to just show "average" but actually cycle through all the sets of votes that is set for each sets of parameters. I checked in the database on the following tables:
 

product_comment
product_comment_criterion

product_comment_criterion_lang

product_comment_grade (This is the table where there 3 sets of parameters is stored)

 

What i dont quite understand is that Prestashop have already made in the configurator possible to add various variables that can be used in the voting, to me it seems that the productcomments_reviews.tpl is not been updated to handle this.

Can anyone help on this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...