# Alle Artikel einer Kategorie

**URL:** <https://forum.shopware.com/t/alle-artikel-einer-kategorie/15997>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [7. Oktober 2013 um 16:20 UTC](https://forum.shopware.com/t/alle-artikel-einer-kategorie/15997 "2013-10-07T16:20:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hesselmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/hesselmann/32/51_2.png) [@hesselmann](https://forum.shopware.com/u/hesselmann)\
**Post date:** [7. Oktober 2013 um 16:20 UTC](https://forum.shopware.com/t/alle-artikel-einer-kategorie/15997/1 "2013-10-07T16:20:04Z")

</div>

Gute Nabend, ich möchte alle Artikel einer Kategorie einer Variable übergeben. Zurzeit tu ich dies mit : `$data = Shopware()-\>Modules()-\>Articles()-\>sGetArticlesByCategory($catID);` Das Problem ist das die Anzahl der Artikel == sPerPage Variable(Default:12) ist. Auschnitt von sGetArticlesByCategory : `$sLimitStart = ($sPage - 1) \* $this-\>sSYSTEM-\>sCONFIG['sARTICLESPERPAGE']; $sLimitEnd = $this-\>sSYSTEM-\>\_GET['sPerPage'] ? $this-\>sSYSTEM-\>\_GET['sPerPage'] : $this-\>sSYSTEM-\>sCONFIG['sARTICLESPERPAGE'];` SQL - Abfrage : `LIMIT $sLimitStart, $sLimitEnd` Vielen Dank für eure Hilfe 🙂

---

<div class="post-metadata">

**Author:** ![hesselmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/hesselmann/32/51_2.png) [@hesselmann](https://forum.shopware.com/u/hesselmann)\
**Post date:** [9. Oktober 2013 um 11:38 UTC](https://forum.shopware.com/t/alle-artikel-einer-kategorie/15997/2 "2013-10-09T11:38:08Z")

</div>

Lösung : Hook erstellen `$hook = $this-\>createHook( 'sArticles', 'sGetArticlesByCategory', 'onArticle', Enlight\_Hook\_HookHandler::TypeBefore, 0 ); $this-\>subscribeHook($hook); ` ` static function onArticle(Enlight\_Hook\_HookArgs $args) { $sPerPage = 500; // Oder mehr Shopware()-\>System()-\>\_GET['sPerPage'] = $sPerPage; unset(Shopware()-\>System()-\>\_SESSION['sPerPage']); } `
