$49

Star Ratings

Documentation  •  Changelog

Documentation

Get total count of ratings cast

Getting the total number of ratings cast is easy...

craft.starRatings.totalVotes(elementId [, key = null])

If you are using an optional key, you can specify that as the second parameter.

{% set totalVotesComfort  = craft.starRatings.totalVotes(hotel.id, 'comfortable') %}
{% set totalVotesClean    = craft.starRatings.totalVotes(hotel.id, 'clean') %}
{% set totalVotesFriendly = craft.starRatings.totalVotes(hotel.id, 'friendlyStaff') %}