=== Fairline – EU consumer rules for WooCommerce ===
Contributors: afkzonagroup
Tags: withdrawal, omnibus, gpsr, legal guarantee, consumer rights
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The withdrawal function, the legal guarantee notice, the lowest price before a discount and product safety information, done carefully.

== Description ==

Every shop that sells to consumers in the EU has to follow the same set of rules. Fairline puts four of them into WooCommerce, with the details right.

= Withdrawal function (Consumer Rights Directive, Article 11a, from 19 June 2026) =

* A "withdraw from contract here" link on every page, on the customer's orders in My account and in order emails – with the wording the directive prescribes, in all 24 official EU languages
* A short form: name, email address and order number, prefilled for logged-in customers and from email links. No reason is asked
* Partial withdrawal: customers can choose the products
* A separate "confirm withdrawal" step, then a receipt on screen and an acknowledgement by email with the statement and the date and time it was received. Failed emails are retried automatically
* Works without JavaScript, with the keyboard and with screen readers; works for guests
* Spam-safe: links and markup are refused, acknowledgements go to the order's own address when the order is known, requests are throttled
* WooCommerce › Withdrawals lists every withdrawal, flags orders that could not be matched and withdrawals after the period, and keeps a note on the order

= Notice on the legal guarantee (Directive (EU) 2024/825, from 27 September 2026) =

* The harmonised notice in the official design, in colour, in the visitor's language (24 languages)
* A "Your legal guarantee rights" link in the footer, on product pages and before "Place order" opens the full notice, with the link to the European Commission's Your Europe page
* The link is added to order emails
* The notice files come straight from the European Commission (see External services) and are shown unmodified

= Lowest price before a discount (Price Indication Directive, Article 6a) =

* Fairline records every price change of every product and variation, including scheduled sales
* During a discount it shows the lowest price of the 30 days before the discount started – never the sale price itself
* That lowest price is also the crossed-out price, so any reduction is measured from it, as the EU Court of Justice requires (case C-330/23)
* Discounts in steps keep the price from before the first step
* Shown on product pages, for each variation, and optionally on shop pages

= Product safety information (GPSR, Regulation (EU) 2023/988, Article 19) =

* Manufacturer, EU responsible person, product identification and safety warnings
* Fill them in once per brand (Products › Brands); products inherit them and can override any field
* Shown in a "Product safety" tab or under the product summary

Fairline helps you meet these rules; it does not replace legal advice, and other obligations (for example refunds and the information in your terms) remain yours.

== External services ==

Fairline connects to the **European Commission's website** only when you press "Download the official notice" under WooCommerce › Settings › Consumer rules › Guarantee notice. It downloads the official notice files (a ZIP archive of about 3 MB) from commission.europa.eu once and stores them in your uploads folder. Nothing about your shop or your customers is sent.

* File page: https://commission.europa.eu/publications/practical-guidelines-and-high-resolution-vector-files-eu-notice-and-label-product-guarantees_en
* Legal notice: https://commission.europa.eu/legal-notice_en

The notice links visitors to the European Commission's Your Europe pages (europa.eu/youreurope).

== Installation ==

1. Install and activate WooCommerce.
2. Install Fairline from Plugins › Add New, or upload the zip, and activate it. A "Withdrawal from a contract" page is created.
3. Under WooCommerce › Settings › Consumer rules › Guarantee notice, press "Download the official notice".
4. Fill in manufacturer details under Products › Brands, and check the other sections of the Consumer rules tab.

== Frequently Asked Questions ==

= Where do customers find the withdrawal function? =

On every page (footer link), in My account on each order, and in their order emails. You can also link the "Withdrawal from a contract" page from your menu.

= How long is the function offered for an order? =

From the order until 14 days after it is completed (or the longer period you set). Withdrawals sent later are still received and flagged for you to decide.

= Why does a discounted product show a different crossed-out price than its regular price? =

Because the law measures a discount from the lowest price in the 30 days before it, not from the regular price. If you ran an earlier sale, that sale price is the reference.

= Fairline was installed while a product was already on sale. What is shown? =

Price history starts when Fairline is activated. For a discount that began earlier, the regular price is shown until there is history from before the discount.

= Does it work with page caching? =

The withdrawal page uses forms with security tokens and a session cookie; exclude it from page caching, like the cart and checkout pages.

= Can the theme change how things look? =

Yes. Copy files from `fairline/templates/` to `yourtheme/fairline/` (emails to `yourtheme/woocommerce/emails/`). The notice image itself must stay unmodified.

== Screenshots ==

1. The withdrawal form
2. The "confirm withdrawal" step
3. WooCommerce › Withdrawals
4. The lowest price before a discount
5. The notice on the legal guarantee
6. Product safety information

== Changelog ==

= 1.0.0 =
* First release.
