# sGetArticleById öffnet Kategoriebaum

**URL:** <https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [5. Juni 2012 um 10:17 UTC](https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298 "2012-06-05T10:17:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bora](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@bora](https://forum.shopware.com/u/bora)\
**Post date:** [5. Juni 2012 um 10:17 UTC](https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298/1 "2012-06-05T10:17:48Z")

</div>

Auf der Startseite habe ich ein Plugin erstellt, für ein paar Artikelboxen (Angebote usw). In dem Plugin benutze ich die Methode sGetArticleById(), was dazu führt, dass die Kategorie ausgeklappt ist, als hätte man das Produkt geöffnet. Hier ein Screenshot von der Startseite

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/d/d5d7b50107f5cfcc6e3052e982564c54727b1c93.png) Es ist immer die Kategorie geöffnet, in der der zuletzt mit sGetArticleById() abgefragte Artikel liegt. Wie kann man das beheben?

---

<div class="post-metadata">

**Author:** ![bora](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@bora](https://forum.shopware.com/u/bora)\
**Post date:** [5. Juni 2012 um 16:55 UTC](https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298/2 "2012-06-05T16:55:03Z")

</div>

Hallo echoooo

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [6. Juni 2012 um 07:47 UTC](https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298/3 "2012-06-06T07:47:47Z")

</div>

Versuch es mal mit sGetPromotionById() [http://wiki.shopware.de/Die-Klasse-sArt … lue.3D0.29](http://wiki.shopware.de/Die-Klasse-sArticles%5C_detail%5C_118.html#sGetPromotionById.28.24mode.2C.24category.3D0.2C.24value.3D0.29) Hier laufen angeblich auch die Aufrufe nicht in die Statistik ein. Ist aber von mir ungetestet. Habe ich nur schon öfters gelesen. Viel Glück

---

<div class="post-metadata">

**Author:** ![bora](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@bora](https://forum.shopware.com/u/bora)\
**Post date:** [6. Juni 2012 um 12:45 UTC](https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298/4 "2012-06-06T12:45:40Z")

</div>

cool, klappt! danke

---

<div class="post-metadata">

**Author:** ![waldicom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/waldicom/32/12881_2.png) [@waldicom](https://forum.shopware.com/u/waldicom)\
**Post date:** [6. Juni 2012 um 14:07 UTC](https://forum.shopware.com/t/sgetarticlebyid-offnet-kategoriebaum/7298/5 "2012-06-06T14:07:01Z")

</div>

[quote=„ottscho“]Versuch es mal mit sGetPromotionById() [http://wiki.shopware.de/Die-Klasse-sArt … lue.3D0.29](http://wiki.shopware.de/Die-Klasse-sArticles%5C_detail%5C_118.html#sGetPromotionById.28.24mode.2C.24category.3D0.2C.24value.3D0.29) Hier laufen angeblich auch die Aufrufe nicht in die Statistik ein. Ist aber von mir ungetestet. Habe ich nur schon öfters gelesen. Viel Glück[/quote] Es ist tatsächlich so! sGetArticleById sollte in den Plugin snicht verwendet werden, weil, wie Du shcon schreibst, die ganzen Statistiken dann falsch sind.
