In WooCommerce, you add the legal guarantee notice to the product page template with a “Custom HTML” block, directly below the add-to-cart button. With classic themes, a small hook in the child theme does the job.
The code for WooCommerce
<div data-garantielabel></div>
<script src="https://www.garantielabel.app/widget.js" async></script>Set further options such as display and language in the code builder.
Step by step in WooCommerce
- Open the template
In WordPress, go to Appearance → Editor → Templates and open “Single Product”. With a classic theme, skip to step 4. - Insert a block
Below the “Add to Cart with Options” block, insert a “Custom HTML” block. - Paste the code
Paste the widget code and save the template. It then applies to all product pages. - Classic theme
Without the block editor, output the code in your child theme via the hookwoocommerce_single_product_summarywith priority 35, or use a snippet plugin.
Things to know about WooCommerce
- Caching and optimisation plugins (for example those that combine JavaScript files) should not modify
widget.js. Exclude the file from optimisation if necessary. - A script in a “Custom HTML” block is only kept if your user is allowed to save custom HTML (the
unfiltered_htmlcapability, on multisite only super admins). Otherwise, load the script with a snippet plugin. - If your shop is multilingual, the widget detects the language from
<html lang>. Usedata-spracheto set it.
Where the notice belongs in WooCommerce
In block themes, you edit the “Single Product” template in the Site Editor. In classic themes, WooCommerce builds the product page from the template content-single-product.php and its hooks:
woocommerce_single_product_summaryfills the summary next to the images. According to the template, it holds the title (priority 5), rating and price (10), short description (20), add-to-cart button (30), meta data (40) and sharing links (50). With priority 35, the widget therefore sits directly below the add-to-cart button.woocommerce_after_single_product_summaryfollows below the summary, before the tabs (10), upsells (15) and related products (20). There, the notice is further away from the buy button.
For the notice in the footer, use the “Footer” template part in block themes. You find it under Appearance → Editor → Patterns, in the template parts. According to WooCommerce, template parts are always synced: a change applies everywhere the footer is used. A “Custom HTML” block with data-darstellung="link" is enough there.
Variations, brand and model identifier
A variable product consists of variations. Each variation has its own fields, including SKU and “GTIN, UPC, EAN, or ISBN”. If they stay empty, the value of the parent product applies. Brands have been part of core since WooCommerce 9.6. You manage them under Products → Brands and select them in the product.
WooCommerce has no dedicated field for the model identifier. The SKU is your own item number and not automatically the producer’s model identifier. The GARAN label names the brand and the model identifier, so there is one label per model identifier. If all variations share one model identifier, one label for the product is enough. The widget shows exactly one GARAN label per placeholder and does not change with the selected variation. If variations have different model identifiers, create these models as separate products, each with its own label.
Typical pitfalls in WooCommerce
- Theme updates: Changes to WooCommerce files or to the parent theme are lost with the next update. That is why you override templates in the child theme, in the folder
woocommerce/. - Outdated templates: WooCommerce does not update overridden templates. You see which ones are outdated at the bottom of WooCommerce → Status → System Status.
- Hook instead of template: The widget needs no overridden template. A hook in the child theme’s
functions.phpis enough. WordPress loads it in addition to the parent theme’s file. - Footer: A change to the template part applies on every page with this footer. There is no preview there, so check the live site.
Further sources
- WooCommerce template content-single-product.php (GitHub)
- WooCommerce: Template structure & overriding templates
- WooCommerce: Fixing outdated WooCommerce templates
- WooCommerce: Patterns and template parts
- WooCommerce: Variable products
- WooCommerce: Brands
- WooCommerce Developer Blog: Brands in WooCommerce 9.6
- WordPress Developer: Child themes
Legal guarantee notice in the order confirmation
According to the Commission’s guidelines, the notice should also appear in the confirmation email. You customise WooCommerce emails under WooCommerce → Settings → Emails. To add the legal guarantee notice to the order email, insert the official graphic from our download page as an image there, depending on your theme via the email templates or an email plugin. A plain link is unlikely to count as a durable medium (CJEU, Case C-49/11, Content Services); the safest way is to put the notice directly in the email as an image, text or attachment. You will find the official files on our download page.
Producer guarantee? Then add the GARAN label
If the producer gives a commercial guarantee of durability of more than two years free of charge for the whole good, the GARAN label also belongs on the product page. With the GARAN label generator you create it in seconds from years, brand and model, your first three labels free and without sign-up. Below every finished label you get an embed code with permanent image URLs: you upload nothing and paste it into WooCommerce as shown above.
Prefer your own files? Then upload the full and the nested version to the media library of WooCommerce and enter the addresses in the widget code:
<div data-garantielabel
data-garan-voll="https://…/GARAN-MX-500.svg"
data-garan-klein="https://…/GARAN-MX-500-nested.svg"></div>The widget then shows the nested version below the legal guarantee notice, and one click opens the full GARAN label.
Frequently asked questions
Do I need a plugin?
No. A “Custom HTML” block is enough. Only with classic themes without the block editor is a snippet plugin or a child theme the easiest way.
Does this work with Elementor or Divi?
Yes. Both have an HTML or code element that you drag below the add-to-cart button in the product template. In Elementor, product templates require Elementor Pro (Theme Builder).
Will my shop get slower?
Hardly. The script is small, loads asynchronously and does not block page rendering.
Why priority 35 for the hook?
According to the WooCommerce template, the add-to-cart button is hooked at priority 30 and the meta data at 40. With 35, the widget sits exactly in between, directly below the buy button.
Does every variation need its own GARAN label?
Only if the variations have different model identifiers. The widget shows one label per placeholder and does not change with the variation. Such models are better created as separate products.
Where do I set the brand for the GARAN label?
Since WooCommerce 9.6, under Products → Brands. You select the brand in the product. The former Brands plugin is no longer needed.