{% sw_extends "@Storefront/storefront/component/review/review.html.twig" %}
{% block component_review_list_action_sortby %}
{{ parent() }}
<script>
let hasExecuted = true;
document.getElementById('reviewsSortby').addEventListener('change', function () {
if (hasExecuted) return;
hasExecuted = true;
const form = document.querySelector('.review-filter-form');
const checkboxes = form.querySelectorAll('input[type="checkbox"]');
checkboxes.forEach(checkbox => {
if (!checkbox.checked) {
checkbox.click();
}
});
});
</script>
{% endblock %}