# Plugin nur in einigen Sprachshops?

**URL:** <https://forum.shopware.com/t/plugin-nur-in-einigen-sprachshops/55156>\
**Category:** Administration\
**Created:** [13. September 2018 um 12:50 UTC](https://forum.shopware.com/t/plugin-nur-in-einigen-sprachshops/55156 "2018-09-13T12:50:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROKAStore](https://avatars.discourse-cdn.com/v4/letter/r/b487fb/32.png) [@ROKAStore](https://forum.shopware.com/u/ROKAStore)\
**Post date:** [13. September 2018 um 12:50 UTC](https://forum.shopware.com/t/plugin-nur-in-einigen-sprachshops/55156/1 "2018-09-13T12:50:07Z")

</div>

Hi, einfache Frage, leider finde ich hier keine schnelle Antwort:

Können Plugins nur für einzelne Sprachshops verwendet werden? Oder sind die automatisch immer auf allen aktiv?

Ich bräuchte ein Plug-in für nur 2 Sprachshops…

Tausend Dank für Eure Hilfe!

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [13. September 2018 um 13:27 UTC](https://forum.shopware.com/t/plugin-nur-in-einigen-sprachshops/55156/2 "2018-09-13T13:27:46Z")

</div>

Kommt auf das Plugin an…

Es kann so gebaut werden, dass man es pro Subshop aktivieren/deaktivieren kann.

---

<div class="post-metadata">

**Author:** ![ROKAStore](https://avatars.discourse-cdn.com/v4/letter/r/b487fb/32.png) [@ROKAStore](https://forum.shopware.com/u/ROKAStore)\
**Post date:** [13. September 2018 um 14:25 UTC](https://forum.shopware.com/t/plugin-nur-in-einigen-sprachshops/55156/3 "2018-09-13T14:25:04Z")

</div>

Hi Moritz,

pro Subshop ok&nbsp; - aber pro Sprachshop?

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [13. September 2018 um 14:52 UTC](https://forum.shopware.com/t/plugin-nur-in-einigen-sprachshops/55156/4 "2018-09-13T14:52:58Z")

</div>

Plugin geht nur “aktiviert / deaktiviert”.  
Wie es oft gemacht wird: (Der Sprachshop bekommt auch einen Tab in der Plugin-Config)  
In der config.xml vom Plugin ein Element, z.b. Dropdown&nbsp; mit “Aktiv: Ja / Nein” und Scope:shop  
Im Plugin an den relevanten Stellen - wo also etwas gemacht wird (event?) - die Config zum Shop lesen und den Wert auslesen. Wenn “nein”, dann Code nicht weiter ausführen “return”

z.B.

```
    pluginIsActive
    Plugin-Funktion im Shop aktiv
    1
    Aktiviert die Pluginfunktionen im aktuellen Shop.

 public function onPostDispatchSearch(\Enlight_Controller_ActionEventArgs $args)
 {
    /** get Plugin-Configuration */
    $pluginConfig = $this->getConfiguration();

    if (!(bool) $pluginConfig['pluginIsActive']) {
        return;
    }
    /* Dein Code */
}

private function getConfiguration() {
    /** return Plugin-Configuration from current shop */
    return $this->container->get('shopware.plugin.cached_config_reader')->getByPluginName($this->getName(), $this->container->get('Shop'));
}
```
