From 5d9fe4af6f8e12814b561a32d468016c4964434c Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Wed, 22 Jul 2026 16:51:25 +0200 Subject: [PATCH 1/5] docs: document plugin snackbar service --- .../the-shopware-object.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md b/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md index 08c65130c8..a157439f55 100644 --- a/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md +++ b/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md @@ -50,6 +50,26 @@ Module.register('your-module', {}); Learn more about them here: [Creating administration module](../module-component-management/add-custom-module.md) +## Display a snackbar + +Use the `snackbarService` for brief feedback in the Administration, such as confirming that a plugin action completed. It displays the message in the global Meteor snackbar. + +```javascript +Shopware.Service('snackbarService').addSnackbar({ + id: 'my-plugin-saved', + message: 'The settings have been saved.', + variant: 'info', +}); +``` + +To dismiss a snackbar before its duration expires, pass the same ID to `removeSnackbar()`: + +```javascript +Shopware.Service('snackbarService').removeSnackbar('my-plugin-saved'); +``` + +The snackbar service is separate from the legacy notification system. Continue using notifications when you need their title, actions, or system-notification behavior. + ## A more general overview We now have discussed the most commonly used parts of the `Shopware` object, but there is much more to discover. Take a look at all these options in a brief overview below: From 030539d89360e75ca4d281b0fcde3a6460c79b36 Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Wed, 22 Jul 2026 16:54:54 +0200 Subject: [PATCH 2/5] docs: colocate snackbar usage with notifications --- .../the-shopware-object.md | 20 ------------------- .../mixins-directives/using-mixins.md | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md b/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md index a157439f55..08c65130c8 100644 --- a/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md +++ b/guides/plugins/plugins/administration/data-handling-processing/the-shopware-object.md @@ -50,26 +50,6 @@ Module.register('your-module', {}); Learn more about them here: [Creating administration module](../module-component-management/add-custom-module.md) -## Display a snackbar - -Use the `snackbarService` for brief feedback in the Administration, such as confirming that a plugin action completed. It displays the message in the global Meteor snackbar. - -```javascript -Shopware.Service('snackbarService').addSnackbar({ - id: 'my-plugin-saved', - message: 'The settings have been saved.', - variant: 'info', -}); -``` - -To dismiss a snackbar before its duration expires, pass the same ID to `removeSnackbar()`: - -```javascript -Shopware.Service('snackbarService').removeSnackbar('my-plugin-saved'); -``` - -The snackbar service is separate from the legacy notification system. Continue using notifications when you need their title, actions, or system-notification behavior. - ## A more general overview We now have discussed the most commonly used parts of the `Shopware` object, but there is much more to discover. Take a look at all these options in a brief overview below: diff --git a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md index d07134d656..4429a5f333 100644 --- a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md +++ b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md @@ -42,3 +42,23 @@ Component.register('swag-basic-example', { } }); ``` + +## Using snackbars for brief feedback + +For brief feedback such as confirming that a plugin action completed, use the global Meteor snackbar instead of the notification mixin: + +```javascript +Shopware.Service('snackbarService').addSnackbar({ + id: 'my-plugin-saved', + message: 'The settings have been saved.', + variant: 'info', +}); +``` + +To dismiss a snackbar before its duration expires, pass the same ID to `removeSnackbar()`: + +```javascript +Shopware.Service('snackbarService').removeSnackbar('my-plugin-saved'); +``` + +The snackbar service is separate from the legacy notification system. Continue using the notification mixin when you need its title, actions, or system-notification behavior. From a1d2a83142f6daef18df8f6cd85059055570dda5 Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Wed, 22 Jul 2026 17:02:03 +0200 Subject: [PATCH 3/5] docs: add snackbar availability note --- .wordlist.txt | 2 ++ .../plugins/administration/mixins-directives/using-mixins.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.wordlist.txt b/.wordlist.txt index bce4dfa739..37c987b09f 100644 --- a/.wordlist.txt +++ b/.wordlist.txt @@ -1978,6 +1978,8 @@ slotConfig slowlog sm smartbar +snackbar +snackbars snakeCase sortings sourcemaps diff --git a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md index 4429a5f333..920ed6b658 100644 --- a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md +++ b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md @@ -45,6 +45,10 @@ Component.register('swag-basic-example', { ## Using snackbars for brief feedback +::: info +The snackbar service is available from Shopware 6.7.14.0. +::: + For brief feedback such as confirming that a plugin action completed, use the global Meteor snackbar instead of the notification mixin: ```javascript From 7eeaaf07f65241a6f055825f0a6813b07d8c8734 Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Thu, 23 Jul 2026 15:15:51 +0200 Subject: [PATCH 4/5] docs: use generated snackbar IDs --- .../administration/mixins-directives/using-mixins.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md index 920ed6b658..157b3e18ae 100644 --- a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md +++ b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md @@ -52,17 +52,16 @@ The snackbar service is available from Shopware 6.7.14.0. For brief feedback such as confirming that a plugin action completed, use the global Meteor snackbar instead of the notification mixin: ```javascript -Shopware.Service('snackbarService').addSnackbar({ - id: 'my-plugin-saved', +const snackbar = Shopware.Service('snackbarService').addSnackbar({ message: 'The settings have been saved.', - variant: 'info', + variant: 'success', }); ``` -To dismiss a snackbar before its duration expires, pass the same ID to `removeSnackbar()`: +To dismiss a snackbar before its duration expires, pass its generated ID to `removeSnackbar()`: ```javascript -Shopware.Service('snackbarService').removeSnackbar('my-plugin-saved'); +Shopware.Service('snackbarService').removeSnackbar(snackbar.id); ``` The snackbar service is separate from the legacy notification system. Continue using the notification mixin when you need its title, actions, or system-notification behavior. From a18ed6faeec0082acb6fbfb97b1d4091ee40c8ca Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Fri, 24 Jul 2026 10:25:25 +0200 Subject: [PATCH 5/5] docs: add snackbar composable usage --- .../mixins-directives/using-mixins.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md index 157b3e18ae..894b32edac 100644 --- a/guides/plugins/plugins/administration/mixins-directives/using-mixins.md +++ b/guides/plugins/plugins/administration/mixins-directives/using-mixins.md @@ -64,4 +64,18 @@ To dismiss a snackbar before its duration expires, pass its generated ID to `rem Shopware.Service('snackbarService').removeSnackbar(snackbar.id); ``` +For Composition API extensions, use the `useSnackbar()` composable. It is experimental until Shopware 6.8.0 and requires the `ADMIN_COMPOSITION_API_EXTENSION_SYSTEM` feature flag: + +```javascript +import useSnackbar from 'src/app/composables/use-snackbar'; + +const { addSnackbar, removeSnackbar } = useSnackbar(); +const snackbar = addSnackbar({ + message: 'The settings have been saved.', + variant: 'success', +}); + +removeSnackbar(snackbar.id); +``` + The snackbar service is separate from the legacy notification system. Continue using the notification mixin when you need its title, actions, or system-notification behavior.