# Storefront js plugin extent im composer project

**URL:** <https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181>\
**Category:** Shopware 6 (German)\
**Tags:** programming\
**Created:** [9. Mai 2025 um 08:47 UTC](https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181 "2025-05-09T08:47:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![theo\_vasconcelos](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@theo\_vasconcelos](https://forum.shopware.com/u/theo_vasconcelos)\
**Post date:** [9. Mai 2025 um 08:47 UTC](https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181/1 "2025-05-09T08:47:51Z")

</div>

Wie macht ihr eine override von storefront js plugin wenn es mit composer an dem project geladen ist ? was in the docs steht funktioniert nicht.

```auto
const PluginManager = window.PluginManager
const Plugin = PluginManager.getPlugin('AddToCompareButton')
const PluginClass = Plugin.get('class')

export default class SynAddToCompareButton extends PluginClass {

    init() {
        super.init()

    }

}

```

auf main js

```auto
PluginManager.override('AddToCompareButton', () => import('./plugin/syn-add-to-compare/syn-add-to-compare-button.js'), '[data-add-to-compare-button]');

```

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [9. Mai 2025 um 09:59 UTC](https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181/2 "2025-05-09T09:59:44Z")

</div>

Vielleicht verstehe ich deine Frage falsch oder auch Composer… aber regelt Composer nicht lediglich dass die Dateien auf den Server gelangen?

Mit der Ausführung des JavaScript hat Composer dann doch nichts mehr zu tun.

---

<div class="post-metadata">

**Author:** ![Anotherone](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Anotherone](https://forum.shopware.com/u/Anotherone)\
**Post date:** [9. Mai 2025 um 11:17 UTC](https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181/3 "2025-05-09T11:17:23Z")

</div>

Versteh ich das richtig, das „AddToCompareButton“ ein externes Plugin (eingebunden via composer) ist?

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [9. Mai 2025 um 14:25 UTC](https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181/4 "2025-05-09T14:25:49Z")

</div>

Ich glaube, ich verstehe das Problem, dank @Anotherone

Dein Plugin liegt wohl in custom/plugins und die composer plugins in vendor.

Der Pfad wird dann vermutlich nicht funktionieren, der die Base unterschiedlich ist.

---

<div class="post-metadata">

**Author:** ![theo\_vasconcelos](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@theo\_vasconcelos](https://forum.shopware.com/u/theo_vasconcelos)\
**Post date:** [13. Mai 2025 um 06:07 UTC](https://forum.shopware.com/t/storefront-js-plugin-extent-im-composer-project/107181/5 "2025-05-13T06:07:54Z")

</div>

genau, liegt in shopware.store ansttat custom/plugins
