{% set order = app.request.query.get('reviews_sort')|default('DESC') %}
{% if product.acceptedReviews|length>1 %}
    <div class="product-reviews-sort-wrapper">
        <p>{{ 'app.ui.product.reviews.sort'|trans }}</p>
        <ul>
            <li>
                <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale, reviews_sort: 'DESC', _fragment: 'product-reviews'}) }}" {% if order == 'DESC'%}class="active"{% endif %} rel="nofollow">
                    {{ 'app.ui.product.reviews.sort_desc'|trans }}
                </a>
            </li>

            <li>
                <a href="{{ path('sylius_shop_product_show', {'slug': product.slug, '_locale': product.translation.locale, reviews_sort: 'ASC', _fragment: 'product-reviews'}) }}" {% if order == 'ASC'%}class="active"{% endif %} rel="nofollow">
                    {{ 'app.ui.product.reviews.sort_asc'|trans }}
                </a>
            </li>
        </ul>
    </div>
{% endif %}

{{ render(url('sylius_shop_partial_product_review_latest', {'productId': product.id, order: order, 'template': '@SyliusShop/ProductReview/_list.html.twig'})) }}
