jgullstr 32 Posted September 13, 2013 Per El Patron's request, I decided to post this here. Don't think there's much demand for such a narrow feature as this, but new developers can check the source for an example of registering your own smarty functions, enforcing module dependencies and rendering templates within a module. Instruction after install: Add {rating id=$product.id_product} where you want the stars to appear in your product-list.tpl. Tip:If you for any reason want to put the module on some other page where the product object is accessible, you can modify the displayHeader hook's condition to support that controller. categorylistratings.zip 1 Share this post Link to post Share on other sites
Cari 4 Posted November 3, 2013 (edited) Nice module! Do you know what code to add to prevent stars from showing if there are no reviews? Also, would you consider extending this so that we can show reviews in the left column? Thanks!! EDIT: Hi guys, Here's a free module to display comments in the left column... http://www.prestashop.com/forums/topic/128975-module-block-latest-comments/ Edited November 11, 2013 by Cari (see edit history) Share this post Link to post Share on other sites
jgullstr 32 Posted November 5, 2013 (edited) Nice module! Do you know what code to add to prevent stars from showing if there are no reviews? Also, would you consider extending this so that we can show reviews in the left column? Thanks!! To hide zero star results, you will have to modify your stars.tpl file as follows: {if $average_total >= 1} (old content) {/if} I have no plans on extending this module. Edited November 5, 2013 by jgullstr (see edit history) 1 Share this post Link to post Share on other sites
Cari 4 Posted November 11, 2013 To hide zero star results, you will have to modify your stars.tpl file as follows: {if $average_total >= 1} (old content) {/if} Thanks 1 Share this post Link to post Share on other sites
Alexgaw 29 Posted January 19, 2014 (edited) Hi, I get empty page when i disable and delete cache and smarty files. I get below error reporting. I run ps 1.5.6.1 Any ideas how to solve this? Further investigation show this is error is caused by this: if($this->context->controller->php_self == 'category'){ Since I run with friendly URL enabled the controller=category is not in the url link anymore. How can this problem be solved to make this module work with friendly URL? Can i just remove this line without causing other issues somewhere else? I Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:\xampp\htdocs\presta1550\themes\alysum_2.0divine\product-list.tpl" on line 71 "<div class="product-info">{rating id=$product.id_product}" unknown tag "rating"' in C:\xampp\htdocs\presta1550\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php:667 Stack trace: #0 C:\xampp\htdocs\presta1550\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php(453): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "ra...', 71) #1 C:\xampp\htdocs\presta1550\tools\smarty\sysplugins\smarty_internal_templateparser.php(2388): Smarty_Internal_TemplateCompilerBase->compileTag('rating', Array) #2 C:\xampp\htdocs\presta1550\tools\smarty\sysplugins\smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r36() #3 C:\xampp\htdocs\presta1550\tools\smarty\sysplugins\smarty_internal_templateparser.php(3201): Smarty_Internal_Templateparser->yy_ in C:\xampp\htdocs\presta1550\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 667 Edited January 19, 2014 by Alexgaw (see edit history) Share this post Link to post Share on other sites
Alexgaw 29 Posted January 29, 2014 The module cause the layered navigation to stop working. Please check how can be solved. Share this post Link to post Share on other sites
CHP 12 Posted July 1, 2014 (edited) {if $average_total >= 1} (old content) {/if} Where I place the code in the tpl?? <div class="star_content clearfix"> {section name="i" start=0 loop=5 step=1} {if $smarty.section.i.index lt $average_total} <div class="star star_on"><a href=""></a></div> {else} <div class="star"><a href=""></a></div> {/if} {/section} </div> It can be put in homefeatured module???? Thanks! Edited July 1, 2014 by CHP (see edit history) Share this post Link to post Share on other sites
jramakrishna122 0 Posted November 12, 2014 Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "C:\xampp\htdocs\cartbiz\modules\homefeatured\views\templates\hook\productsblock.tpl" on line 64 "{rating id=$product.id_product}" unknown tag "rating" <-- thrown in C:\xampp\htdocs\cartbiz\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 64 Share this post Link to post Share on other sites
loostaq 0 Posted February 20, 2015 The module cause the layered navigation to stop working. Please check how can be solved. Did anyone find a solution to this? I'm having the same problem, it gives server error (500) Share this post Link to post Share on other sites
patrmich 5 Posted May 15, 2015 Hi, Thank you for offering the free module to add rating to product list on Prestashop. Such module allows the display of the number of stars for each item on the product list page. Would you know how to also display the number of comments for each item on the product list page ? My shop is built with Prestashop 1.5.6.2. Thank you in advance for any reply. Kind Regards, Patrick Share this post Link to post Share on other sites
StefArts 1 Posted January 10, 2017 (edited) Hello, I'm trying to display products stars ratings on the product list My prestashop version is 1.6.1.6 I have tried this module and it does not work correctly. I'm getting a white page... I also see these lines in product_list.tpl: {capture name='displayProductListReviews'}{hook h='displayProductListReviews' product=$product}{/capture} {if $smarty.capture.displayProductListReviews} <div class="hook-reviews"> {hook h='displayProductListReviews' product=$product} </div> {/if} I believe that the function is already there but I cannot find where to activate it Does someone knows how to do it? Thank you. Regards Edited January 10, 2017 by StefArts (see edit history) Share this post Link to post Share on other sites
patrmich 5 Posted July 18, 2017 Hello, The module prevents the layered navigation to work. The error message is the following : PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/product-list.tpl" on line 105 "{rating id=$product.id_product}" unknown tag "rating" Did anyone find the way to solve the matter ? Thank you in advance, Patrick Share this post Link to post Share on other sites