Available right now
permanently, no running costs
You buy the licence directly from us and get an invoice from us. Install by upload in the admin without SSH, updates through our licensing platform, support straight from the developer.
How to collapse long product descriptions elegantly - with a soft fade, freely chosen height and an accessible button.
Shopware 6.7; 6.6 works as well. The storefront theme has to inherit the Twig block component_product_description_content_text from @Storefront/storefront/component/product/description.html.twig - which the Shopware default theme and the usual forks do.
The JavaScript ships as a pre-built bundle, so a storefront build is not required. The styles are merged into the theme during theme:compile.
In the admin under Extensions, My Extensions, StawReadMoreDirect, Configuration.
Two values work together. The maximum height decides how much text stays visible. The minimum overshoot prevents the button from appearing for texts that are only marginally longer.
The gradient at the bottom signals that the text continues. The fade colour matters: it has to match the background at that point, otherwise you get a visible edge. On a coloured or dark theme, adjust it accordingly.
With this option, collapsing only applies below 768 pixels width. On desktop the description stays fully visible. Useful when the space problem is mainly on phones.
Optionally the expanded state is stored in sessionStorage. On the next product in the same session the text stays open. Closing the browser resets it.
The text is not removed from the document; it is hidden with the CSS property max-height. Search engines therefore see the full product description.
The toggle reports its state via aria-expanded, works with the keyboard and has a visible focus ring. The description stays accessible without a mouse and with a screen reader.
Four variables are available for fine tuning in your theme:
The plugin overrides the Twig block component_product_description_content_text. A PHP subscriber hooks into ProductPageLoadedEvent and passes the configuration through as the page extension stawReadMore. In the storefront a pre-built JavaScript bundle registers through the Shopware plugin manager on elements carrying data-staw-read-more="true".
The height is measured again after images have loaded so it does not come out too small. A ResizeObserver covers the case where the description initially sits in a closed tab or accordion and therefore has no measurable height.
description.html.twig. The one under page/product-detail/ has been deprecated since 6.6.1.0 and is no longer rendered in 6.7. The active one sits under component/product/, recognisable by the block names starting with component_.Check whether the text actually exceeds the maximum height plus the threshold. With 320 plus 80 pixels, nothing happens below a text height of 400 pixels - by design.
The fade colour does not match the page background. On coloured or dark themes it has to be adjusted.
Usually theme:compile or clearing the cache is missing. Also check that your theme inherits the Twig block named above.
The plugin re-measures after images load. If it stays wrong, the description usually sits in an area that is hidden on load - the ResizeObserver handles that as soon as it becomes visible.
We are happy to answer questions about setup or adapting the plugin to a custom theme. Get in touch via the contact page or write to info@stoneandwater.online.
Two routes, the same feature set - pick whichever suits your setup.
permanently, no running costs
You buy the licence directly from us and get an invoice from us. Install by upload in the admin without SSH, updates through our licensing platform, support straight from the developer.
The plugin will be listed in the official Shopware Community Store. Installation and automatic updates then run through the plugin manager, billing through your Shopware account. We will link it here as soon as it is live.
Find every option on the product page. We are happy to help with setup and styling.