Forums / Setup & design / Creating average review results

Creating average review results

Author Message

David Barker

Thursday 31 July 2003 3:40:16 pm

Hi,
I am going to use the enum variable in the products review class to create a review of 1 to 5 with 5 different stars but I would also like to create an average result for the review. Like if it got two reviews of 2/5 and 4/5, the average would be 3/5.

I was thinking maybe I could do this by making a new field in the 'product' class called 'Average Review' and have eZpublish insert the average review into that. What I would like to know is how to do make eZpublish calculate the average review (if possible) and how to make it insert it into the product it is assosicated with.

Thanks!

Dave