=== EU Legal-Guarantee Notice & GARAN Durability Label for WooCommerce ===
Contributors: garanlabs
Tags: legal guarantee, warranty, consumer rights, woocommerce, eu, garan, durability label, guarantee notice, ecommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.9.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add the official EU legal-guarantee notice (Regulation (EU) 2025/1960) and the GARAN durability label to WooCommerce — product pages, checkout, and order emails, in 24 EU languages.

== Description ==

Regulation (EU) 2025/1960 introduces a harmonised **legal-guarantee notice** and a **durability label (GARAN)** for goods sold to consumers in the EU. **EU Legal-Guarantee Notice & GARAN Durability Label for WooCommerce** adds both official graphics to your WooCommerce store — automatically on every product page, at checkout, and in order confirmation emails — in the official language of your choice, out of all 24 EU languages.

Everything below is **100% free**. There is no Pro version, no license key, and no locked feature.

This plugin is a display helper. It shows the official harmonised graphics as intended by the Regulation. It does **not** provide legal advice and does **not** guarantee that your store is legally compliant — whether and how the rules apply to your business is for you (and, if needed, your legal advisor) to determine.

EU Legal-Guarantee Notice & GARAN Durability Label for WooCommerce is an independent WooCommerce plugin and is **not affiliated with or endorsed by** the European Union or the European Commission.

**Features**

**EU Legal-Guarantee Notice (Annex I)**

* The official harmonised legal-guarantee notice, in all **24 EU languages**, rendered from the Commission's own artwork — not a re-creation.
* Automatic placement on every WooCommerce product page, at 7 selectable positions (before the summary, under the product image, after the title, after the price, after the short description, after Add to cart, or near the tabs).
* Three display modes: **Popup** (compact row that opens the full notice in a dialog), **Full** (the complete graphic shown inline) or **Nested** (a compact trigger that expands the full graphic in place).
* Three trigger row styles — Minimal, Classic (teal "View" button), or Custom (your own clickable text, with a shield icon and adjustable font size).
* Optional **header notice**: a "Your legal guarantee rights" link automatically added to your site's navigation menu (desktop, tablet and mobile), with a hover preview and click-to-open modal — falls back to a standalone banner if no menu can be found.
* Shows automatically on the **Checkout page**, under the "Checkout" heading — works with both the classic shortcode checkout and the WooCommerce block-based checkout.
* Optional inclusion in **WooCommerce order confirmation emails** (processing, on-hold, completed, and customer invoice), in both HTML and plain-text format, customer-facing only (never the admin's own copy) — choose between a full embedded graphic, a compact text line with a link, or the graphic sent as a real **file attachment**.
* Click-to-open notice with a direct link to the matching **Your Europe** legal-guarantee information page for your selected language.
* Manual placement anywhere via the `[eu_guarantee_notice]` shortcode or the "EU Guarantee Notice" Gutenberg block.
* Optional "Powered by GARAN Labs" credit line.

**GARAN Durability Label (Annex II)**

* Appears automatically for any product with a manufacturer guarantee of **3 years or more**, configured in a dedicated **"EU Guarantee" product data tab** (duration in whole years, Brand/Trademark, Model identifier) — with inline help text on the eligibility threshold and a live label preview as you type.
* **Artwork-fit safeguards** so long Brand/Trademark or Model text never breaks the label design: a 40-character cap enforced both in the editor (with a live counter) and on save, plus automatic font-shrinking with ellipsis truncation when the compact label graphic is rendered for order emails.
* Rendered from **vector SVG** artwork, so it stays sharp at any size, with a site-wide adjustable badge width.
* Same three display modes (Popup / Full / Nested) and the same 7 position choices as the notice, set independently per widget.
* Shown at **checkout** (classic and block checkout) and on the classic **Cart page**, under each qualifying item's thumbnail, with its own separate, smaller badge-width setting.
* Optional inclusion in **order confirmation emails** (HTML and plain-text, customer-facing only), per qualifying product — a compact text line with a link, the full label graphic embedded directly (rendered server-side with the bundled font and template, no ImageMagick/librsvg required), or sent as a real **file attachment**.
* Manual placement via the `[eu_garan]` shortcode (optionally overriding years/brand/model explicitly, e.g. `[eu_garan years="5" brand="Acme" model="AC-1200"]`, which skips the eligibility check) or the "GARAN Label" Gutenberg block, with its own live preview in the editor.
* Links through to the official **Your Europe** commercial-durability-guarantee information page.
* Site-wide enable/disable toggle independent of per-product settings.
* **Vendor GARAN label image upload**: if a manufacturer or vendor already supplies you with a ready-made GARAN durability label image for a product, upload it on the dedicated **"Vendor GARAN Labels"** admin page (under EU Guarantee & GARAN) — it then replaces the generated label everywhere it would normally show for that product: product page, checkout, cart, shortcode/block, and order-confirmation emails (link, embedded, and attachment formats alike). Qualifies the product on its own, with no need to also fill in its Duration/Brand/Model/confirmation fields — an optional "Duration (years)" field on the same page fills in just the compact preview badge's number.

**Under the hood**

* Everything renders **locally** as static graphics from your own server — the plugin makes no outbound API calls and sends no shop or shopper data anywhere, ever.
* No account, license key, or third-party service required — install and it works.
* Choose your store's display language from all 24 official EU languages, with an automatic fallback to English if a translated graphic is ever missing.
* Built for WooCommerce's product, cart, checkout, and email templates (both HTML and plain-text order emails), and for the WordPress Block Editor.
* **Lightweight**: CSS/JS only load on the pages that actually need them (product, checkout, cart, or wherever the header notice appears) — no dashboard-wide bloat.
* Fully translatable admin interface, with a dedicated text domain.
* Clean removal: settings are kept on delete/reinstall by default, or fully wiped via an opt-in "delete all settings on uninstall" toggle.

**Keywords:** EU legal guarantee notice, guarantee of conformity, GARAN durability label, durability label, Regulation (EU) 2025/1960, Consumer Rights Directive, WooCommerce warranty, WooCommerce guarantee plugin, consumer rights notice, product guarantee label, EU consumer protection, warranty notice WooCommerce.

== Installation ==

1. Install and activate the plugin (WooCommerce required).
2. Go to the **EU Guarantee & GARAN** main menu.
3. Choose your **display language** and save.
4. The EU legal-guarantee notice now appears on your product pages. Set a manufacturer guarantee of 3+ years under a product's **Product data → EU Guarantee** tab to also show the GARAN durability label.
5. Optionally turn on the header notice, checkout placement, and order-email content from the **Display** settings tab.

== Frequently Asked Questions ==

= Does this make my store legally compliant? =
No. The plugin only displays the official harmonised graphics. Whether the Regulation applies to you and how to comply is your responsibility; consult a professional for legal questions.

= Which languages are supported? =
All 24 official EU languages. The official notice graphic is shown in the language you select in the plugin's settings.

= Does it require WooCommerce? =
Yes, WooCommerce must be installed and active — the notice and label attach to WooCommerce's product, cart, checkout, and email templates.

= Does it send any customer data anywhere? =
No. The notice and label are static graphics rendered locally by your own server; the plugin does not call out to any external service and requires no account or license key.

= Can I show the notice or label somewhere other than the automatic product-page position? =
Yes — use the `[eu_guarantee_notice]` and `[eu_garan]` shortcodes, or the matching "EU Guarantee Notice" and "GARAN Label" Gutenberg blocks, anywhere in your content.

= Can shoppers see the notice and label at checkout? =
Yes, both can be shown on the checkout page (classic and block checkout), and the GARAN label also appears on the classic Cart page.

= Can I include these in order confirmation emails? =
Yes. Turn on "Order confirmation email" for either the notice or the GARAN label, then choose how it's delivered: a compact text line with a link, the full graphic embedded in the email body, or the graphic sent as a file attachment.

= Is there a paid/Pro version? =
No. Every feature in this plugin is free and fully functional.

= Is this an official EU plugin? =
No. It's an independent WooCommerce plugin that displays the Commission's own harmonised artwork; it is not affiliated with or endorsed by the European Union or the European Commission.

= What stops the Brand/Trademark or Model text from breaking the label design? =
Those fields are capped at 40 characters, enforced both in the product editor (with a live counter) and on save. When the label graphic is generated for order emails, the text is additionally auto-shrunk to fit and truncated with an ellipsis if still too long.

= Can I use my own label image instead of the generated one? =
Yes. If a manufacturer or vendor already supplies a ready-made GARAN label graphic for a product, upload it on the "Vendor GARAN Labels" admin page (search for the product, pick the image). It then replaces the generated label everywhere for that product — product page, checkout, cart, and order emails — until you remove it.

== Screenshots ==

1. Legal Guarantee Notice (Annex I) settings.
2. GARAN Durability Label (Annex II) settings.
3. Display languages.
4. Advanced settings.
5. Upload a vendor label for a product

== Changelog ==

= 1.9.0 =
* Added a "Vendor GARAN Labels" admin page (under EU Guarantee & GARAN) to upload a manufacturer/vendor-supplied GARAN label image for a specific product — it then takes over from the generated label everywhere it would normally show: product page, checkout, cart, shortcode/block, and all three order-confirmation email formats. A vendor image qualifies the product on its own, without also requiring its Duration/confirmation fields to be filled in, and an optional "Duration (years)" field on the same page fills in the compact preview badge's number independently of that product-level workflow.

= 1.8.0 =
* Added an "Attachment" email content option for both the legal-guarantee notice and the GARAN label — sends the graphic to the customer as a real file attachment on order confirmation emails, instead of embedding or linking it.
* The notice's compact trigger row now shows just the notice title, without the "at least 2 years" sub-line.
* The "Guarantee duration" product field's minimum is now 3 years, matching the label's own eligibility threshold.
* Changed the plugin's main admin menu icon to a shield.

= 1.7.1 =
* Fixed the "Under the product image" position to render inside the product gallery itself (right after the thumbnails, inside `.woocommerce-product-gallery__wrapper`) instead of just above the summary column.

= 1.7.0 =
* Added a new position choice, "Under the product image", for both the notice and the GARAN label position settings — places the widget right below the product gallery, above the title/summary column.

= 1.6.1 =
* The GARAN label's Popup mode trigger is now the compact GARAN badge (years | GARAN ✓ | EU shield) instead of a plain text row — clicking it still opens the same dialog with the full label.

= 1.6.0 =
* Split the "Display mode" setting into two independent settings — "Notice display mode" and "GARAN label display mode" — so each can be set to Popup, Full or Nested on its own. Sites that already set the old shared display mode keep that choice until either new setting is changed.

= 1.5.0 =
* Added a third Display mode: "Nested" — a compact trigger (the GARAN badge for the label, the existing summary row for the notice) that expands the full graphic in place when clicked, instead of opening a dialog or always showing the full graphic.
* Fixed a possible colour mix-up when the label's SVG markup is rendered more than once on the same page (e.g. the nested badge and its expanded panel together): the source files' CSS classes weren't scoped per instance, so two copies could repaint each other's shapes with the wrong colour. Classes are now namespaced the same way the QR code's clip-paths already were.

= 1.4.0 =
* The GARAN durability label now renders from a vector SVG (assets/official/garan-full.svg) instead of a flattened raster image, so Brand/Trademark, Model identifier and the guarantee-duration number are set directly on the real design text — sharper at any size, and pixel-perfect alignment in both the admin preview and the storefront.
* Fixed a possible ID collision in the label's QR code artwork when the label markup is rendered more than once on the same page (e.g. a quick-view modal open alongside the main product).

= 1.3.0 =
* The legal-guarantee notice and the GARAN label are now independent widgets: each has its own position on the product page (before the summary, after the title, after the price, after the short description, after Add to cart, or after the summary near the tabs).
* Added a "Display mode" setting: Popup (compact summary that opens the full graphic in a dialog, the previous behaviour) or Full (the full graphic shown directly on the page, no click required). Applies to both the notice and the label.

= 1.2.0 =
* Added site-wide toggles on the Display settings tab to enable/disable the legal-guarantee notice and the GARAN durability label independently, across the whole store, regardless of per-product settings.

= 1.1.0 =
* Redesigned the "EU Guarantee" product data tab: a "Show GARAN label" toggle, guarantee duration in whole years, Brand/Trademark and Model identifier fields (with a live label preview), and a single combined producer-confirmation checkbox.
* The GARAN label now shows the Brand/Trademark and Model identifier you enter per product, falling back to the product's brand attribute/name when left blank.

= 1.0.0 =
* Initial release: EU legal-guarantee notice (Annex I) in 24 languages and the GARAN durability label (Annex II), with a tabbed-modal product-page widget and a dedicated product data tab for guarantee fields.
