Originally posted by lesliekirk
View Post
Not the actual reviews - just the stars (pretty much like every eCommerce store has). I think I've got something in place but I think it might be more than is needed:
Code:
<mvt:item name="tgreviews" param="Product_Review_Count( l.settings:product:id, l.settings:product:customfield_values:tgreviews:tgr_review_count )" /> <mvt:if expr="l.settings:product:customfield_values:tgreviws:tgr_review_count GT 0"> <mvt:item name="tgreviews" param="Product_Rating( l.settings:product:id, l.settings:product:customfield_values:tgreviews:tgr_rating )" /> </mvt:if> <mvt:item name="tgreviews" param="Product_Review_Count( l.settings:product:id, l.settings:product:customfield_values:tgreviews:tg r_review_count )" /> <mvt:if expr="l.settings:product:customfield_values:tgreviews:tgr_review_count GT 0"> <mvt:item name="tgreviews" param="Product_Rating( l.settings:product:id, l.settings:product:customfield_values:tgreviews:tgr_rating )" /> </mvt:if> <mvt:if expr="( l.settings:product:customfield_values:tgreviews:tgr_review_count GT 0 ) AND ( NOT ISNULL l.settings:product:customfield_values:tgreviews:tgr_rating )"> <mvt:item name="tgreviews" param="Product_Rating( l.settings:product:id, l.settings:tgr:avg_rating )" /> <div class="tgreviews-average"> <mvt:assign name="l.settings:star_width" value="( l.settings:product:customfield_values:tgreviews:tgr_rating / 5 ) * 100" /> <span class="tgreviews-average__star" title="&mvte:product:customfield_values:tgreviews: tgr_rating; out of 5."> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="tgreviews-average__star-overlay" style="width:&mvte:star_width;%;"> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> <span class="u-icon-star-full"></span> </span> </span>(&mvte:product:customfield_values:tgreviews:tgr_review_count;) </div> </mvt:if>
Now to figure out how to make the stars on the product page open up the Reviews tab (I did this eons ago, now to just find the code).
Comment