# Service Überschreiben. Abhängigkeiten bleiben bestehen. Was tun?

**URL:** https://forum.shopware.com/t/service-ueberschreiben-abhaengigkeiten-bleiben-bestehen-was-tun/86817
**Category:** Programmierung
**Created:** [13. April 2021 um 07:03 UTC](https://forum.shopware.com/t/service-ueberschreiben-abhaengigkeiten-bleiben-bestehen-was-tun/86817 "2021-04-13T07:03:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![\_MikeB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/_mikeb/32/7856_2.png) [@\_MikeB](https://forum.shopware.com/u/_MikeB)
#### Post date: [13. April 2021 um 07:03 UTC](https://forum.shopware.com/t/service-ueberschreiben-abhaengigkeiten-bleiben-bestehen-was-tun/86817/1 "2021-04-13T07:03:39Z")

</div>

Hi.

Ich versuche wie folgt einen Service zu überschreiben:  
\<service id=„PLUGINNAME\Service\AvailableCombinationLoaderDecorator“ decorates=„Shopware\Core\Content\Product\SalesChannel\Detail\AvailableCombinationLoader“\>  
\<argument type=„service“ id=„PLUGINNAME\Service\AvailableCombinationLoaderDecorator.inner“ /\>  
\<argument type=„service“ id=„Doctrine\DBAL\Connection“/\>  
\</service\>

Erhalte dann aber folgende Fehlermeldung:  
Argument 2 passed to Shopware\Core\Content\Product\SalesChannel\Detail\ProductConfiguratorLoader::\_\_construct() must be an instance of Shopware\Core\Content\Product\SalesChannel\Detail\AvailableCombinationLoader, instance of PLUGINNAME\Service\AvailableCombinationLoaderDecorator given

Habe dann noch folgendes probiert aber leider ohne weitere Auswirkung:  
\<service id=„Shopware\Core\Content\Product\SalesChannel\Detail\ProductConfiguratorLoader“\>  
\<argument type=„service“ id=„product\_configurator\_setting.repository“/\>  
\<argument type=„service“ id=„PLUGINNAME\Service\AvailableCombinationLoaderDecorator“/\>  
\</service\>

Was mache ich falsch?

Gruß Mike

---

<div class="post-metadata">

### Author: ![\_MikeB](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/_mikeb/32/7856_2.png) [@\_MikeB](https://forum.shopware.com/u/_MikeB)
#### Post date: [14. April 2021 um 12:03 UTC](https://forum.shopware.com/t/service-ueberschreiben-abhaengigkeiten-bleiben-bestehen-was-tun/86817/3 "2021-04-14T12:03:49Z")

</div>

Hi Shopwarian.

Danke für dein Feedback. Die Reihenfolge passt so da ich diese ja auch so in meinem Service erwarte. In deinem Tutorial ist der Parentservice das letzte Argument deshalb passt die Platzierung am Ende des Services in der XML.

Komme einfach nicht weiter ☹
