Is there a way to automatically calculate and display the average rating and total review count for products in a Webflow e-commerce site without using client-side JavaScript?
I have a Product collection and a separate Review collection, with reviews linked to products. I need to:
- Calculate the average rating from all reviews for each product
- Count the total number of reviews for each product
- Display these values on the product page
- Include these values in the product’s structured data for SEO
Currently, I’m using JavaScript to calculate these on page load, but I’m looking for a server-side or CMS-based solution that updates these values automatically as reviews are added or changed. Are there any native Webflow features, integrations, or best practices to achieve this without relying on client-side calculations?
I’m sure this must be quite a normal use case for webflow ecommerce websites. Using structured data to add the review count and rating. Since these are calculated fields, I just need to know how to get that in my head code. I can’t imagine that these are static fields that are manually updated in the product collection.
I did try using custom code to update the structured data json directly after the DOM has loaded. However at that point the structured would have already been pulled as showing 0 ratings. I checked google schema markup validator and that also showed 0 ratings under the product. So custom code to update it doesn’t seem to work either.
Thanks