My Reviews Badge is not showing when i "sort by" my Collection Page

Highlighted
New Member
2 0 0

Hi there,

I am having a issue that when i load a collection everything works well as it should i can see the reviews. But when i try to filter the products by sort by function. The function sort by works but the reviews badge dissappear from the collection page. then i need to reload it again to get the reviews badge in product thumbnails. 

https://www.mechestore.com/collections/all-3d-printers

 

you can go to the above URL and try it your self. Thank you

Looking forward for help

 

Regards

Arslan A.

0 Likes
Highlighted
Shopify Expert
1381 111 200

hi,

hope you doing good 

 

i thing collection page review code is missing this reason review not show 

0 Likes
Highlighted
Shopify Partner
20 1 2

Hi -aa, I suppose that you are using ajax to load the products when filtering. I noticed that Shopify Product Review needs to reinitialized everytime that an ajax is made. So, if it's your case try to put this code at the end of your ajax response.

 

SPR.registerCallbacks();
SPR.initRatingHandler();
SPR.initDomEls();
SPR.loadProducts();
SPR.loadBadges();

if you don't have access to the ajax request , you can simulate a HTTP request to force SRP reinitialize inside a callback function.

var request = new XMLHttpRequest();
request.open("GET", "");
request.onload = function() {
      SPR.registerCallbacks();
      SPR.initRatingHandler();
      SPR.initDomEls();
      SPR.loadProducts();
      SPR.loadBadges();
};
request.send();

Until now i didn't find out a better solution for this problem. I contacted the app support as well but they didn't solve the problem.

 

Hope that it helps you!

1 Like