Originally posted by heatherwebdev
View Post
Announcement
Collapse
No announcement yet.
Product Reviews by Tess Breakdown Display
Collapse
X
-
add this to the style of the div that holds the breakdown elements
HTML Code:style="display: flex; flex-direction: column-reverse;"
Leave a comment:
-
lesliekirk the variable l.settings:breakdown:rating within the foreach loop are the numbers 1-5. To reverse them you would just use the QuickSortArray MivaScript function before the foreach loop.
Putting that before the foreach loop will sort the ratings in reverse order.Code:<mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:tgr:breakdown, ':rating',-1)" />
- 1 like
Leave a comment:
-
-
Yes, I know, but I don't quite see what controls the display order:Originally posted by Nick View Postlesliekirk that template is available in Settings > System Extension Settings > Product: Reviews Settings under the Reviews Template tab:
reviews.png
The link within this code will display a specific set of reviews if you click the star. I think I understand that this calculates the percentage:Code:<mvt:foreach iterator="breakdown" array="tgr:breakdown"> <mvt:assign name="l.settings:breakdown:percent" value="( l.settings:breakdown:count / l.settings:tgr:review_count ) * 100" /> <div class="tgreviews-breakdown"> <div class="tgreviews-breakdown__rating"> <mvt:if expr="l.settings:breakdown:count GT 0"> <span><a href="&mvte:tgr:link;?TGR_Sort=&mvta:global:TGR_So rt;&TGR_Show_Rating=&mvta:breakdown:rating;" title="View Reviews with a rating of &mvte:breakdown:rating;">&mvte:breakdown:rating ;</a></span> <mvt:else> <span>&mvte:breakdown:rating;</span> </mvt:if> <span class="tgreviews-breakdown__star"><span class="u-icon-star-full"></span></span> </div> <div class="tgreviews-breakdown__percent" title="&mvte:breakdown:count; Reviews out of &mvte:tgr:review_count; are rated &mvte:breakdown:rating;"> <div class="tgreviews-breakdown__percentage"> <div class="tgreviews-breakdown__percentage-overlay" style="width: &mvte:breakdown:percent;%;"></div> </div> </div> <div class="tgreviews-breakdown__count" title="&mvte:breakdown:count; Reviews out of &mvte:tgr:review_count; are rated &mvte:breakdown:rating;"> &mvte:breakdown:count; </div> </div> </mvt:foreach>
I also see in the "Sort By", which is initially configured in the Review Settings > Default Sorting MethodCode:<mvt:assign name="l.settings:breakdown:percent" value="( l.settings:breakdown:count / l.settings:tgr:review_count ) * 100" />
That made me wonder if something from that section of code could be used. That is when I figured I would post to the forum to see if anyone else had come up against this...
Leave a comment:
-
lesliekirk that template is available in Settings > System Extension Settings > Product: Reviews Settings under the Reviews Template tab:
reviews.png
Leave a comment:
-
Product Reviews by Tess Breakdown Display
Is there a way to change the Breakdown Display in the Reviews Template for the Product Reviews Version 2.012 module? Currently, it's displaying 1-5. I need it to be 5-1
emuTXt.png
Tags: None
Leave a comment: