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

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

Replies 4 (4)
Qualitycheck
Shopify Expert
1432 114 232

hi,

hope you doing good 

 

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

marquinhos
Shopify Partner
21 1 4

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!

nvassalo
Shopify Partner
3 0 2

This solution with force AJAX did it for me, but only after navigating to the product page with AJAX. If landing page, it can't read SPR on time and throws an undefined error.

TeamDO
Shopify Partner
9 0 1

Hi Marquinhos Did you find a solution to this problem?
I tried the things you instructed but it still doesn't work on our website now
Product review not showing if on collection page using ajax