From e96a24160232d66f8b6bfa47305fe0c7b40e184d Mon Sep 17 00:00:00 2001 From: Nico-Schaefer-2111 <57937533+Nico-Schaefer-2111@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:20:36 +0100 Subject: [PATCH] Update override-existing-javascript.md - add note for overriding async JS-Plugin --- .../storefront/override-existing-javascript.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guides/plugins/plugins/storefront/override-existing-javascript.md b/guides/plugins/plugins/storefront/override-existing-javascript.md index 81c2befa7..530c5284d 100644 --- a/guides/plugins/plugins/storefront/override-existing-javascript.md +++ b/guides/plugins/plugins/storefront/override-existing-javascript.md @@ -49,6 +49,18 @@ export default class MyCookiePermission extends PluginClass { } ``` + +::: info +This does not work, if the plugin you want to override is an async plugin. Currently you need to import a third-party plugin like below. +::: + +```javascript +import ThirdPartyPluginClass from '../../../../../../../../../vendor/store.shopware.com/thirdparty/src/Resources/app/storefront/src/plugin/third-party-js-plugin-dir/third-party-js.plugin'; + +export default class MyCookiePermission extends ThirdPartyPluginClass { +} +``` + Now you can override the functions from the parent class. ### Always show the cookie bar