prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
229 stars 127 forks source link

Prestashop productcomments module has infinite loop #240

Closed lmeyer1 closed 3 years ago

lmeyer1 commented 3 years ago

When using productcomments, there is an infinite loop making ajax requests when displaying product lists. It is calling for https://[product page url].html?id_products%5B%5D=undefined&id_products%5B%5D=undefined Certainly this is related to #216 Prestashop productcomments has switched to returning JSON and to undefined in the URL.

I'm investigating, and will probably offer a pull request.

lmeyer1 commented 3 years ago

This problem is due to this change https://github.com/PrestaShop/productcomments/commit/778b526a947e1b7732a0638cbb31765f277fe747#diff-d41b9c8e4c75000eb2aa6fd52df613f814a8e4b10758155a281e1ac704542ba8 on 9.11.2019

They have a pending merge request on their side, that would fix the infinite loop, but fail to load the grades: https://github.com/PrestaShop/productcomments/pull/96

lmeyer1 commented 3 years ago

@prestarocket This seems to be part of a larger problem: classic-rocket uses material icons stars for rating and generates this in the template themes/classic-rocket/modules/productcomments/views/templates/hook/product-list-reviews.tpl productcomments now loads grades via ajax, and display the grade via the jquery grade plugin. Their template only contains empty divs.

There are two solutions:

  1. we keep material icons for rating
    • we then would not need the new js file modules/productcomments/views/js/productListingComments.js and could just put it empty in our template (do not load anything via ajax).
  2. we use their way of displaying the rating

The first solution looks nicer (esthetically). The second one would mean to loose the added value of our improved template. On the other hand, I don't know if there is a advantage in the way productcomments now works.

What is your opinion? I'm solving the problem along solution 1.

prestarocket commented 3 years ago

to check in https://github.com/prestarocket-agence/classic-rocket/releases/tag/3.1.0

lmeyer1 commented 3 years ago

@prestarocket Thanks, this is fixed in 3.1.0