Get Free Audit

How To Add Rating To Product List In Prestashop

Jul 2, 2013

1459 Alex Simonchik

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”.

Andrey_Dubina
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey


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.

development_prestashop

PrestaShop Development

Take your online store to the next level with BelVG PrestaShop Development

Visit the page
Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

16 Comments

  1. 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

  2. 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

  3. I confirm it’s not working for 1.6.0.14

    Hope Alex can do an update ;)

    Regards,

    Pol

  4. 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

  5. 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

  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. 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.

  8. 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.

  9. NIk,

    here there is the Install function where the hook hookActionProductListOverride() is registered

  10. 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 ((

  11. 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 “&”.

  12. 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

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *