Yossefelbaz Posted January 29, 2013 Share Posted January 29, 2013 (edited) Hi. I added the module Products Comments to the modules and i added Criterion called Rating to have Star Rating system with it. Now i want to have the stars to be also shown next to the product name. I went to the product.tpl file and i added the lines of code {if $comments} {if $criterions|@count > 0} <div class="comment_criterions"> <div> {section loop=6 step=1 start=1 name=average} <input class="auto-submit-star" disabled="disabled" type="radio" name="average" {if $averageTotal|round neq 0 and $smarty.section.average.index eq $averageTotal|round}checked="checked"{/if} /> {/section} </div> </div> {/if} {/if} This code is from the productcomments.tpl file. This part handling the rating stars. But, i cannot see it working. It shows only gray stars... How can i make it also available in the product.tpl page? Next i might want to add it to the productlist.tpl too... You can see any product (without comments yet) here -> www.dressmeupny.com And the one with comment here -> http://www.dressmeupny.com/mac-duggal/42898r.html Thanks. Edited January 29, 2013 by Yossefelbaz (see edit history) Link to comment Share on other sites More sharing options...
Yossefelbaz Posted January 29, 2013 Author Share Posted January 29, 2013 I figured to have my own script added: product.tpl {* right column *} <div id="pb-left-column"> <h1>{$product->name|escape:'htmlall':'UTF-8'}</h1> {if $comments} {if $criterions|@count > 0} <div id="average_rated"> {for $stars=1 to $averageTotal} <div class="comment_grade"></div> {/for} {if $averageTotal<5} {for $stars=1 to 5-$averageTotal} <div class="comment_grade_not"></div> {/for} {/if} </div> {/if} {/if} global.css div.comment_grade {float:left;width:17px;height:15px;overflow:hidden;text-indent:-999em; background:url(../../../modules/productcomments/img/star.png) 0 -16px no-repeat;} div.comment_grade_not {float:left;width:17px;height:15px;overflow:hidden;text-indent:-999em; background:url(../../../modules/productcomments/img/star.png) 0 0 no-repeat;} This is working! Link to comment Share on other sites More sharing options...
belladict Posted February 14, 2013 Share Posted February 14, 2013 Nice! Did you figure out how to display the average grade/rating in the product-list.tpl? Link to comment Share on other sites More sharing options...
Yossefelbaz Posted February 15, 2013 Author Share Posted February 15, 2013 Not yet, i will get to it very soon... I will update this topic right when i have it done. Link to comment Share on other sites More sharing options...
Recommended Posts