# Im Plugin Controller den richtigen Subshop

**URL:** https://forum.shopware.com/t/im-plugin-controller-den-richtigen-subshop/92803
**Category:** Shopware 5
**Created:** [5. Februar 2022 um 20:56 UTC](https://forum.shopware.com/t/im-plugin-controller-den-richtigen-subshop/92803 "2022-02-05T20:56:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [5. Februar 2022 um 20:56 UTC](https://forum.shopware.com/t/im-plugin-controller-den-richtigen-subshop/92803/1 "2022-02-05T20:56:34Z")

</div>

Hi,  
ich habe mehrere Subshops.  
Dann habe ich einen Plugin, welches von jedem Subshop aufgerufen werden kann.  
Gibt es eine Methode, dass ich die ID des Subshops nicht aus dem Frontend mitsenden muss, und mir der Controller selbst seine Subshop ID verrät?

Danke und Gruss

---

<div class="post-metadata">

### Author: ![d.garding](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/d.garding/32/10544_2.png) [@d.garding](https://forum.shopware.com/u/d.garding)
#### Post date: [7. Februar 2022 um 07:07 UTC](https://forum.shopware.com/t/im-plugin-controller-den-richtigen-subshop/92803/2 "2022-02-07T07:07:48Z")

</div>

Hallo,

$this-\>container-\>get(‚shopware\_storefront.context\_service‘)-\>getShopContext()-\>getShop()-\>getId();

Wenn ich das richtig verstehe, sollte dir das obige snippet helfen

LG

Dennis

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [7. Februar 2022 um 07:07 UTC](https://forum.shopware.com/t/im-plugin-controller-den-richtigen-subshop/92803/3 "2022-02-07T07:07:54Z")

</div>

Vielleicht Shopware()-\>Shop()-\>getId()

---

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [16. Februar 2022 um 15:30 UTC](https://forum.shopware.com/t/im-plugin-controller-den-richtigen-subshop/92803/4 "2022-02-16T15:30:39Z")

</div>

Die Anführungszeichen waren falsch escaped.
