How To Add Rating To Product List In Prestashop

July 2, 2013 Alex Simonchik Prestashop
How To Add Rating To Product List In Prestashop

If you are using the Prestashop module “Product comments” you would probably like to be able to display product’s rating not only on the product page but on catalog pages as well.

How To Add Rating To Product List In Prestashop

One day, I got the following page design:

How To Add Rating To Product List In Prestashop

Since this is quite a frequently submitted task and I did not want to solve it again in future, I created the module “Belvg Product List Rating”:

How To Add Rating To Product List In Prestashop

It uses the hook “асtiоnPrоduсtListOverride” to transmit missing product’s rating data to the array data, which are used in the template product-list.tpl. The product rating data are taken from the tables of the module “prоduсtсоmments”.

The received data I am using in the template “product-list.tpl”:

Please note that if you want to use this module along with «Layered navigation block»,then the standard module should be located above our module:

How To Add Rating To Product List In Prestashop

You are welcome to download it here.



16 comments

  1. Nice tut, thanks. Though the way PS gives the possibility of changing product list presentation through hooks it’s not very intuitive. I expected a hook for each product in the list not change the entire list

  2. Enrique,

    As far as I understand you would like to know why this hook changed the data which are used in product-list. But this happens because when the hook is called the data are transmitted via the link with the help of “&”.

  3. Bit is clear.
    Where in which to embed files

    public function hookActionProductListOverride($params)
    {………………………………………

    ———-
    Tried to insert into class after the product is not going to request ((

  4. Barrabas,

    This article is applicable for the version 1.5. But I can say that there are no big differences if compared with the version 1.6, except for the bootstrap technology. Perhaps, you will just need to make some minor changes in the markup.

  5. Hi,
    In prestashop1.6 we have possiblity to override de modules, go to the root/override/modules then create a folder called productcomments then create a file called productcomments.php
    in this file we can make override without lost our code after upgrade.

  6. Soufiane,

    With what version does this work? I checked the class classes / PrestaShopAutoload.php, which is responsible for creating an index of classes and have not found any reference to modules.

  7. I got this working, but after selecting something on Layered Navigation Block, the stars disappeared (from the source code too). The Layered Navigation block is above this as instructed. Any solution? Using version 1.5.4.0

  8. Hi Alex,

    Did you try it in 1.6.14 version, please?
    I already read that it is working in 1.6 version but not to me :(

    Thank you

    Jeremy

  9. I confirm it’s not working for 1.6.0.14

    Hope Alex can do an update ;)

    Regards,

    Pol

  10. Hi, is it possible to make this work on homepage? I have product-list.tpl included in homepage and I would like to have the rating there too. It works just fine in category page.

    Thanks

  11. Is that module still available? Download link does not work anymore – shows a 404.
    I’m looking for a solution for PS 1.6.0.14 – thanks for your feedback.
    best regards, Roland

Post a new comment

top