我想计算结果。我已经像总组结果和总结果一样完成了一个产品....
喜欢:-
总产品组 = 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 %}