# Hersteller erweitern um Produktanzahl

**URL:** <https://forum.shopware.com/t/hersteller-erweitern-um-produktanzahl/93698>\
**Category:** Programmierung\
**Created:** [28. März 2022 um 17:49 UTC](https://forum.shopware.com/t/hersteller-erweitern-um-produktanzahl/93698 "2022-03-28T17:49:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexBS](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@AlexBS](https://forum.shopware.com/u/AlexBS)\
**Post date:** [28. März 2022 um 17:49 UTC](https://forum.shopware.com/t/hersteller-erweitern-um-produktanzahl/93698/1 "2022-03-28T17:49:57Z")

</div>

Hallo,

für mein eigenes Brands Plugin hole ich mir alle Hersteller und möchte dazu noch die Produktanzahl haben.  
$criteria-\>addAssociation(‚products‘) gibt mir ja alle Produkte zum Hersteller dazu. Ich könnte im Template dann ein |length Filter anwenden, nur fühlt sich das alles sehr rechenintensiv an.

Wie kann ich direkt den count statt der gesamten ProductCollection mitgeben?

LG Alex
