Available Functions
The following functions you can call in your twig.
craft.productReview.getAllReviews(rating, status, sort, limit)
Retrieve all customer-submitted reviews.
rating (optional): Filter reviews by rating value (1 to 5). Use null to show all ratings.
status(optional): Filter reviews based on status. Available options: live, pending, null. Default live.
sort (optional): Sort reviews, with the default being by
dateCreated DESC.
limit (optional): Limit the number of reviews shown.
Example
{% set reviews = craft.productReview.getAllReviews(null, 'live', "rating DESC", 10) %}
{% for review in reviews %}
{{ review.rating }}
{% endfor %}
craft.productReview.getReviewById(id, status)
Retrieve customer reviews based on ID.
id(required): ID of the review.
status(optional): Filter reviews based on status. Available options: live, pending, null. Default live.
Example
{% set review = craft.productReview.getReviewById(1) %}
craft.productReview.getPendingReviewById(id)
Retrieve pending customer reviews based on ID.
Example
{% set review = craft.productReview.getPendingReviewById(1) %}
Last updated