In OXID eShop 7, you add the legal guarantee notice below the add-to-basket button with a template extension: in the Twig block details_productmain_tobasket of the APEX theme, via a small module or a child theme. A CMS page in the admin is not enough, because the editor removes scripts and there is no free CMS slot on the product page.
The code for OXID eShop
<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 OXID eShop
- Module or child theme
The extension belongs in a small module or a child theme (intheme.phpwith'parentTheme' => 'apex') so that updates of the APEX theme do not overwrite it. You activate it under Extensions → Modules or Extensions → Themes. You need file access for this; usually your agency takes care of it. - Extend the block
Extend the templatepage/details/inc/productmain.html.twigand paste the widget code in the blockdetails_productmain_tobasketafter{{ parent() }}. Withparent(), the add-to-basket button stays unchanged. - GARAN label per product
For your own GARAN labels, create two attributes under Administer Products → Attributes, for example “GARAN full” and “GARAN small”, and enter the addresses of the two files on the product under Selection → Assign Attributes. In the template, output the values indata-garan-vollanddata-garan-klein. - Clear the cache
Clear the template cache withvendor/bin/oe-console oe:cache:clearand check the product page, including variants.
In a module, the file is located at views/twig/extensions/themes/apex/page/details/inc/productmain.html.twig and looks like this:
{% extends 'page/details/inc/productmain.html.twig' %}
{% block details_productmain_tobasket %}
{{ parent() }}
<div data-garantielabel></div>
<script src="https://www.garantielabel.app/widget.js" async></script>
{% endblock %}Things to know about OXID eShop
- The CMS page editor removes
<script>. From OXID 7.5 there is also an HTML sanitizer that removes scripts when it is switched on. The code therefore belongs in the template. - By default, assigned attributes also appear in the list of product properties on the detail page. Hide the two GARAN attributes there in the template if needed.
- OXID 6 with the Smarty themes Flow and Wave: the block has the same name. Modules hook it in via
blocksinmetadata.php; the template ispage/details/inc/productmain.tpl.
Legal guarantee notice in the order confirmation
According to the Commission’s guidelines, the notice should also appear in the confirmation email. The order confirmation uses the CMS page with the ident oxuserorderemail, which you edit under Customer Info → CMS Pages. JavaScript does not run in emails, so add the official graphic there as an image. 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.
Sources
- OXID developer documentation: extending a block of an active theme
- OXID developer documentation: creating a child theme
- OXID developer documentation: HTML sanitizer (7.5)
- OXID user documentation: products, Selection tab
- OXID user documentation: CMS pages
- APEX theme on GitHub (product page template)
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, free and without sign-up. With a free account, you get an embed code with permanent image URLs below the finished label: you upload nothing and paste it into OXID eShop as shown above.
Prefer your own files? Then upload the full and the nested version to the media library of OXID eShop 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
Can I simply paste the code into a CMS page?
Not reliably. The editor removes the script, and there is no standard slot on the product page where a CMS page appears automatically. A small template extension is the safe way.
Do I have to change the APEX theme itself?
No. A module or child theme with {{ parent() }} is enough. The original theme stays updatable, and the buy button stays as it is.
Where do I enter the GARAN label per product?
For example as an attribute value on the product under Selection → Assign Attributes. The template then reads the addresses and passes them to the widget.