# Tutorial: Plugins mit Shopware

**URL:** <https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [15. Oktober 2012 um 15:04 UTC](https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241 "2012-10-15T15:04:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwoerdehoff](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pwoerdehoff](https://forum.shopware.com/u/pwoerdehoff)\
**Post date:** [15. Oktober 2012 um 15:04 UTC](https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241/1 "2012-10-15T15:04:22Z")

</div>

Hallo liebe ShopWare Community, ich bin gerade dabei mich in ShopWare einzuarbeiten. Bei dem [Tutorial: Plugins mit Shopware](http://wiki.shopware.de/Tutorial-Plugins-mit-Shopware%5C_detail%5C_523%5C_487.html) stoße ich allerdings auf ein Error, den ich nicht beheben kann: `Fatal error: Call to undefined method Zend\_Locale::getId() in /Applications/MAMP/htdocs/shopware/engine/Shopware/Plugins/Community/Backend/SnippetTextFile/Bootstrap.php on line 36 ` Dieser wird durch folgenden Code hervorgerufen: `$locale = Shopware()-\>Locale()-\>getId();` Das Problem dabei ist, dass Shopware()-\>Locale() ein Zend\_Locale object zurückliefert, wobei das Tutorial von einem Enlight\_Components\_Locale ausgeht, das von Zend\_Local erbt. Hat jemand eine Idee wie ich an die entsprechende Enlight\_Components\_Locale komme? Freundliche Grüße, Philipp Edit: Es handelt sich um eine frische ShopWare 4 Installation, sowie um die Beispieldateien, die zum Download angeboten werden.

---

<div class="post-metadata">

**Author:** ![Patrick\_Stahl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrick_stahl/32/7679_2.png) [@Patrick\_Stahl](https://forum.shopware.com/u/Patrick_Stahl)\
**Post date:** [15. Oktober 2012 um 17:42 UTC](https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241/2 "2012-10-15T17:42:49Z")

</div>

Hallo pwoerdehoff, das Plugin ist nicht für Shopware 4 geeignet. Daher kommt vermutlich der Fehler. Alle Plugins, die [hier](http://wiki.shopware.de/Developers-Guide%5C_cat%5C_487.html) aufgelistet sind, sollten mit Shopware 4 kompatibel sein. Hilft dir das weiter? Gruß, Patrick :shopware:

---

<div class="post-metadata">

**Author:** ![pwoerdehoff](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pwoerdehoff](https://forum.shopware.com/u/pwoerdehoff)\
**Post date:** [16. Oktober 2012 um 09:43 UTC](https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241/3 "2012-10-16T09:43:09Z")

</div>

Hey Patrick, das Tutorial wurde in [Entwicklung von Backend-Modulen](http://wiki.shopware.de/Entwicklung-von-Backend-Modulen%5C_detail%5C_818%5C_487.html), welches sich in der Liste befindet, als „Einstieg“ empfohlen. Es kann ja sein das es nicht funktioniert, ich verstehe nur nicht, weshalb der Fehler an dieser Stelle auftritt. Das Plugin Auth z.B. verwendet auch Locale und in dem Fall von Auth, wird Enlight\_Components\_Locale zurückgeliefert. Der Aufruf sieht hier auch ein wenig anders aus, funktioniert bei mir im Tutorial aber auch nicht ☹ Das Auth Plugin ist unter /engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php zu finden…

---

<div class="post-metadata">

**Author:** ![Stefan\_Hamann](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Stefan\_Hamann](https://forum.shopware.com/u/Stefan_Hamann)\
**Post date:** [16. Oktober 2012 um 10:00 UTC](https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241/4 "2012-10-16T10:00:16Z")

</div>

`Shopware()-\>Shop()-\>getLocale()-\>getId() ` Müsste eigentlich klappen - die aktuelle Sprache (= Locale) kann also über das Shop-Objekt abgefragt werden.

---

<div class="post-metadata">

**Author:** ![pwoerdehoff](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pwoerdehoff](https://forum.shopware.com/u/pwoerdehoff)\
**Post date:** [16. Oktober 2012 um 10:40 UTC](https://forum.shopware.com/t/tutorial-plugins-mit-shopware/9241/5 "2012-10-16T10:40:22Z")

</div>

Hey Stefan, vielen Dank für deine Antwort. Der Code funktioniert super bei mir! :thumbup:
