Shopware GARAN Label Customization: Mastering Placement in Shopping Experiences
Shopware GARAN Label Customization: Mastering Placement in Shopping Experiences
In the dynamic world of e-commerce, balancing legal compliance with a compelling user experience is paramount. Shopware, a leading platform, provides robust tools for both, but sometimes merchants require a finer touch to align default functionalities with their unique brand identity and design principles. One such area often requiring customization is the placement of legally mandated elements, like the GARAN (guarantee) label.
At Migrate My Store, we understand that every pixel counts. This blog post, inspired by a common query on the Shopware forum, delves into how you can take control of your Shopware GARAN label's position, particularly when leveraging the powerful Shopping Experiences (Erlebniswelten) feature.
The Challenge: Beyond the Default Buy Box
The standard Shopware implementation places the GARAN label directly beneath the "Add to cart" button on product detail pages. While functional and compliant, this default position might not always be ideal for every store's aesthetic or conversion strategy. Merchants often seek to move this label to a more prominent, less intrusive, or simply different location within their product templates.
The core questions that arise are typically two-fold: Is the default placement a legal requirement? And how can developers achieve custom placement using Shopware's Twig templating engine, especially in versions like Shopware 6.6 and beyond?
Initial discussions in the community sometimes reveal uncertainty about the GARAN label's functionality across different Shopware versions or the complexity of custom coding. However, as clarified by experts in the Shopware forum, a robust and elegant solution exists for modern Shopware installations.
Featured Illustration:

Legal Clarity: Flexibility in Placement
One of the most crucial aspects to address is the legal standing of the GARAN label's position. According to insights from the Shopware community, and based on general interpretations of EU regulations, there is no strict legal mandate dictating the exact placement of the guarantee label on a product page. The key requirement is that the information must be clearly visible and accessible to the customer on the product detail page itself, not merely deferred to the checkout process.
The default position chosen by Shopware is a practical standard, ensuring compliance out-of-the-box. However, it is not a fixed legal requirement. This flexibility empowers merchants and developers to integrate the label more harmoniously into their unique page layouts. Nevertheless, for absolute legal certainty, especially in specific jurisdictions or for complex product categories, always consult with a legal professional specializing in e-commerce law.
The Technical Solution: A Step-by-Step Twig Guide
For Shopware 6.6.10.24 and later versions, the GARAN label functionality is fully integrated and accessible via Twig. The label resides within the buy_widget_garan_label block in the storefront/component/buy-widget/buy-widget.html.twig template. This template is precisely what powers the Buy-Box within your Shopping Experiences.
Step 1: Removing the GARAN Label from its Default Position
To move the label, the first step is to prevent it from rendering in its original location. This is achieved by extending the relevant Twig template within your custom theme. Create the file Resources/views/storefront/component/buy-widget/buy-widget.html.twig in your theme directory and add the following code:
{% sw_extends '@Storefront/storefront/component/buy-widget/buy-widget.html.twig' %}
{% block buy_widget_garan_label %}{% endblock %}
This code effectively overrides the original block, rendering it empty and thus removing the GARAN label from its default spot under the "Add to cart" button.
Step 2: Copying the GARAN Label Block to a Custom File
Next, you need to make the GARAN label's content available for inclusion elsewhere. Locate the original block in vendor/shopware/storefront/Resources/views/storefront/component/buy-widget/buy-widget.html.twig. Copy the entire content of the buy_widget_garan_label block (from {% block buy_widget_garan_label %} to its corresponding {% endblock %}) into a new, custom Twig file within your theme, for example, Resources/views/storefront/component/product/garan-label.html.twig.
By copying the block, you create a standalone, reusable component that contains all the necessary HTML, data attributes, and scripts for the GARAN label to function correctly, including its expandable toggle mechanism.
Step 3: Including the Label in Your Desired Location within Shopping Experiences
Now that you have a portable GARAN label component, you can include it anywhere within your Shopping Experiences. Product detail pages built with Shopping Experiences make the product data available as page.product within the element templates.
For instance, if you want to place the label below an image gallery element, you would extend the gallery's template (e.g., element/cms-element-image-gallery.html.twig) and include your custom GARAN label file within an appropriate block:
{% if page.product ?? false %}
{% sw_include '@Storefront/storefront/component/product/garan-label.html.twig' with { product: page.product } %}
{% endif %}
The {% if page.product ?? false %} condition is crucial. It ensures that the GARAN label is only rendered when a product context is available, preventing errors if the element is used on a page without a specific product (e.g., a category page or a general content page).
The beauty of this approach is that the GARAN label's interactive functionality (like expanding to show details) and its styling are decoupled from the Buy-Box. Shopware attaches the necessary JavaScript to the data-garan-label-toggle attribute, meaning it will work correctly regardless of where you place the label on the page.
In-Content Illustration:

Considerations for Advanced Customization and Maintenance
While the above steps provide significant flexibility, there are a few important considerations:
- Updates: When Shopware releases updates, especially for 6.6.x versions, always review the original
buy_widget_garan_labelblock in the vendor folder. If Shopware makes changes to the label's structure or functionality, your copied custom block will not automatically inherit these updates. You may need to manually merge or re-copy changes to ensure continued compliance and functionality. - Full CMS Element: If you require truly free-form placement of the GARAN label as a drag-and-drop element within Shopping Experiences, similar to a standard text block or image, you would need to develop a custom CMS element. This involves more extensive development work, including creating a new Twig template for the element, a corresponding PHP class, and potentially a JavaScript component for its configuration in the admin panel.
- Theme Structure: Always perform these customizations within a custom theme to ensure your changes are update-safe and do not get overwritten during Shopware core updates.
Empowering Your Shopware Store
Customizing the GARAN label's position is a prime example of how Shopware's flexible architecture empowers merchants to fine-tune their storefronts. By understanding and utilizing Twig templating, you can achieve a product page layout that not only meets legal requirements but also enhances user experience and aligns perfectly with your brand's design vision.
At Migrate My Store, we specialize in helping businesses leverage the full potential of Shopware, from seamless migrations to bespoke development and optimization. If you're looking to enhance your Shopware store or need expert assistance with complex customizations, don't hesitate to reach out to our team of Shopware migration and development specialists.