DmfUspBanner
DmfUspBanner shows your customer benefits above the storefront header: free shipping over a threshold, a returns period, delivery times. The banner shares its row with the language and currency switchers and colours the whole strip.
It is maintained per sales channel, and every text is translatable. Before Guppy 2.8.0 this lived in the theme configuration, where every sales channel using the same theme shared one set of texts and there was no language dimension at all.
Quick facts
| Composer package | dmf/sw6-plugin-usp-banner |
| Plugin class | Dmf\UspBanner\DmfUspBanner |
| Namespace | Dmf\UspBanner |
| Shopware | >= 6.7.0 |
| Requires | DmfSplideSlider |
| Storage | Own entity dmf_usp_banner, one banner per sales channel |
| Maintained in | Content → USP banner |
| Repository | dmf / plugin-usp-banner |
Installation
composer require dmf/sw6-plugin-usp-banner
bin/console plugin:refresh
bin/console plugin:install --activate DmfUspBanner
bin/console cache:clear
bin/console administration:build
bin/console theme:compileFeatures
- Two layouts: Standard (one text with an optional link) and Benefits (up to three texts side by side, turning into a slider once they no longer fit).
- One banner per sales channel, backed by a unique index. Channels that already have one are not offered in the select.
- Every text is translatable, the link included, so a bilingual shop points each language at its own landing page.
- Link selection through the same picker the Shopping Experiences use: category, product, media file, e-mail address, phone number or an external URL.
- WCAG 2.1 AA contrast check right below the colour pickers, with a warning below 4.5:1 (BFSG).
- Own ACL privileges under
dmf_usp_banner(viewer, editor, creator, deleter). - Storefront snippets for de-DE, en-GB, es-ES, fr-FR, it-IT, nl-NL and pl-PL.
Configuration
Unlike most plugins, DmfUspBanner ships no plugin configuration. Banners are created in the administration under Content → USP banner, because they are maintained per sales channel and per language.
| Field | Type | Default | Effect |
|---|---|---|---|
| Sales channel | select | – | The channel this banner belongs to. Exactly one per channel. |
| Enabled | bool | false | Off hides the banner regardless of its content. |
| Layout | select | Standard | Decides which of the fields below are read. |
| Text | text, translated | – | Standard only. Without a text in the current language the banner does not render there. |
| Link | link picker, translated | – | Standard only. Without a link the text is rendered unlinked. |
| Open link in a new tab | bool | false | Adds target="_blank" with rel="noopener". |
| Link position | select | Center | Left or Center, relative to the page. Ignored from two benefits onwards. |
| Benefit 1 to 3 | text, translated | – | Benefits only. Empty slots are closed up rather than rendered as a gap. |
| Background colour | colour | #EEEEEE | Colours the whole strip, switchers included. |
| Text colour | colour | #2B3136 | Applies to the banner text and the switchers beside it. |
| Hover colour | colour | – | Optional. Left empty, everything keeps the text colour on hover. |
Usage
- In the administration open Content → USP banner and choose Add USP banner.
- Select the sales channel and enable the banner.
- Pick the layout: Standard for one statement with a link, Benefits for up to three customer benefits.
- Enter the texts. Use the language switch in the smart bar to maintain each language separately.
- Set the colours and check the contrast value below the pickers.
- Save.
Limitations
Texts from the theme configuration are not migrated
If you maintained a USP banner through the theme settings before Guppy 2.8.0, enter the texts here once. The theme cannot write into a plugin that may not be installed.
Three fixed benefit fields
The Benefits layout has exactly three fields. More benefits require a migration in the plugin.
Themes overriding the top bar block
The banner renders from core's layout_header_top_bar block. A theme overriding that block without calling parent() drops the banner.
Notes
- Exactly one banner per sales channel. A second one cannot be staged behind the current banner, so changing what it says always overwrites what is live.
- Internal link targets are stored as a placeholder and resolved at render time, so the same banner links correctly in every sales channel and language.
- Below a viewport width of 1200 pixels the benefits turn into a slider.
- The banner's background colour overrides the theme's top bar background colour while the banner is shown.
Related
- DmfSplideSlider: provides the slider for the benefits.
- All plugins
- Recommended plugins