Я хочу подсчитать результат. Я уже сделал это как общий результат группы и общий результат в одном продукте....
как:-
Общая группа продуктов = 15
В одной группе показано 36 товаров.
Во второй группе показано 56 товаров.
Я хочу показать общий результат группового продукта = 36+56 => 92. без цикла for.
файл ветки:
<table>
<h2> Showing {{ templates | length }} Products</h2>
{% for groupResults in templates %}
{% if groupResults.doclist.docs[0].first_product_name is defined %}
Show all {{ groupResults | length }} results
<tr>
<td>
{{ groupResults.doclist.docs[0].first_product_name }}
{% if groupResults.doclist.numFound > 4 %}
<a href="{{ path("design_picker_catalog", { "productSlug": groupResults.doclist.docs[0].first_product_slug, "search": searchTerm }) }}" style="float:right">Show all {{ groupResults.doclist.numFound }} results</a>
{% endif %}
</td>
</tr>
<tr>
{% set count = 0 %}
{% for template in groupResults.doclist.docs %}
<td>
<a href="{{ path("customer_design_editor", { "templateSlug": template.slug, "productSlug": template.product_slug[0] }) }}">
<img src="{{ path("design_template_thumbnail_by_slug", { "slug": template.slug}) }}" alt="" />
</a>
</td>
{% set count = count + 1 %}
{% endfor %}
{% if count < 4 %}
{% for i in count..3 %}
<td> </td>
{% endfor %}
{% endif %}
{% else %}
{% endif %}
{% endfor %}