> For the complete documentation index, see [llms.txt](https://aodihis.gitbook.io/product-review/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aodihis.gitbook.io/product-review/reviews/submitting-a-review.md).

# Submitting a review

To submit a review, you can make a post request to `product-review/review/save` action endpoint.

Params

<table><thead><tr><th width="156">Param</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>Required. The ID of the review that will be saved.</td></tr><tr><td><code>rating</code></td><td>Required. The rating value for the product.</td></tr><tr><td><code>comment</code></td><td>Optional. The reviewer's comment for the product.</td></tr></tbody></table>

```
{% set reviewId = craft.app.request.getRequiredParam('id') %}
{% set review = craft.productReview.getReviewById(reviewId, null) %}
{% if not review or review.reviewer.id != currentUser.id %}
  {% redirect 'shop/customer' %}
{% endif %}

<form id="reviewForm" method="post">
    {{ csrfInput() }}
    {{ actionInput('product-review/review/save') }}
    {{ redirectInput('/shop/customer/review-history') }}
    <input type="hidden" name="id" value="{{review.id}}"/>
    <div class="rating">
        <!-- Notice that the stars are in reverse order -->
        <input type="radio" id="star5" name="rating" value="5">
        <label for="star5">&#9733;</label>
        <input type="radio" id="star4" name="rating" value="4">
        <label for="star4">&#9733;</label>
        <input type="radio" id="star3" name="rating" value="3">
        <label for="star3">&#9733;</label>
        <input type="radio" id="star2" name="rating" value="2">
        <label for="star2">&#9733;</label>
        <input type="radio" id="star1" name="rating" value="1">
        <label for="star1">&#9733;</label>
    </div>
    <div class="comment">
        <label for="comment">Tell us more:</label><br>
        <textarea id="comment" name="comment"></textarea>
    </div>
    <button type="submit" class="submit-btn">Submit</button>
</form>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aodihis.gitbook.io/product-review/reviews/submitting-a-review.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
