{#
Review Components
=================
Product review display and submission components.
Usage:
{% from 'shared/macros/storefront/reviews.html' import review_list, review_card, review_form, review_summary %}
#}
{% from 'shared/macros/storefront/star-rating.html' import star_rating, rating_input, rating_summary %}
{#
Review Card
===========
Individual product review display.
Parameters:
- review: Static review object
- review_var: Alpine.js expression for review (dynamic)
- show_avatar: Show reviewer avatar (default: true)
- show_verified: Show verified purchase badge (default: true)
- show_helpful: Show helpful buttons (default: true)
- show_images: Show review images (default: true)
- on_helpful: Callback for helpful button click
Review structure:
{
id: 1,
author_name: 'John D.',
author_avatar: null,
rating: 5,
title: 'Great product!',
content: 'Really happy with this purchase...',
verified: true,
created_at: '2025-01-15',
helpful_count: 42,
images: []
}
Usage:
{{ review_card(review_var='review') }}
#}
{% macro review_card(
review=none,
review_var=none,
show_avatar=true,
show_verified=true,
show_helpful=true,
show_images=true,
on_helpful=none
) %}
{% if review_var %}
{{ empty_message }}
Help others by sharing your experience with this product.