{# # Product Rating (Bootstrap 5 Override) # # Renders the star rating with review count link on the single product page. # # Expected context: # product - WC_Product object (from TemplateOverride) # # WooCommerce PHP equivalent: single-product/rating.php # # @package WcBootstrap # @since 0.1.0 #} {# Guard: bail if ratings are disabled. #} {% if fn('wc_review_ratings_enabled') %} {# Compute rating data from product object when not passed as context. #} {% if rating_count is not defined %} {% set rating_count = product.get_rating_count() %} {% set review_count = product.get_review_count() %} {% set average = product.get_average_rating() %} {% endif %} {% if rating_count > 0 %}
{% if review_count > 0 %} {{ fn('_n', '%s customer review', '%s customer reviews', review_count, 'woocommerce')|format(review_count) }} {% endif %}
{% endif %} {% endif %}{# wc_review_ratings_enabled #}