=== Withdrawly – EU Withdrawal Button for WooCommerce ===
Contributors: withdrawly
Tags: withdrawal, right of withdrawal, eu, woocommerce, returns
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
WC requires at least: 8.0
WC tested up to: 10.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The "Withdraw from contract here" function required by EU Directive 2023/2673: two-step form for guests, partial withdrawal, instant confirmation e-mail.

== Description ==

Since 19 June 2026, online shops selling to consumers in the EU must offer a **withdrawal function** (Article 11a of Directive 2011/83/EU, added by Directive 2023/2673): a clearly labelled function such as "Withdraw from contract here", available for the whole withdrawal period, a separate confirmation function, and an immediate confirmation of receipt on a durable medium.

Withdrawly adds exactly that to WooCommerce, in a few minutes and without changing your checkout.

= What your customers get =

* **A link on every page** – "Withdraw from contract here" at the bottom of the site (or wherever you place the `[withdrawly_link]` shortcode).
* **No account needed** – guests enter their name, e-mail and order number. Logged-in customers get a button next to each order in My Account and go straight to the confirmation step.
* **Two separate steps** – the form, then a distinct "Confirm withdrawal" button. No dark patterns, no extra hoops.
* **Partial withdrawal** – the whole order or selected products and quantities.
* **Optional reason** – clearly marked as optional.
* **Immediate confirmation e-mail** – with the date and time of receipt, a reference number and the full content of the statement.

= What you get =

* A log of all withdrawal statements (WooCommerce → Withdrawals) with status: new, accepted, refunded, rejected.
* An order note on every statement and the order status "Withdrawal requested" when the whole order is withdrawn.
* An e-mail to the shop with the customer as Reply-To.
* Late statements are accepted and flagged, so you can decide (or refuse them – your choice).
* The withdrawal period starts at order completion (delivery) or at the order date, 14 days or longer.
* A link to the withdrawal function in customer order e-mails.
* Rate limiting against order-number guessing; a generic message that never reveals whether an order exists.
* Compatible with HPOS (custom order tables) and the block cart/checkout.
* Translations: English, Polish (Odstąp od umowy tutaj), German (Vertrag hier widerrufen).

= Withdrawly Pro (separate add-on) =

* CSV export of all statements.
* One-click refund of exactly the withdrawn items (plus the standard shipping cost for a whole order), manually or through the payment gateway.
* Daily reminder about statements waiting longer than you choose (refunds are due within 14 days).
* Webhook for new statements (Slack, n8n, Zapier, Make).

Withdrawly helps you implement the withdrawal function. It is not legal advice; check the national rules of the countries you sell to.

== Installation ==

1. Install and activate WooCommerce.
2. Install and activate Withdrawly. A page "Withdrawal from contract" with the `[withdrawly_form]` shortcode is created automatically.
3. Check WooCommerce → Withdrawal settings. The link appears at the bottom of every page right away.
4. Block themes: optionally add the `[withdrawly_link]` shortcode to your footer template.

== Frequently Asked Questions ==

= Do customers need an account? =
No. Requiring registration is not allowed. Guests use their order number and the e-mail address from the order.

= What does the confirmation e-mail contain? =
The reference number, date and time of receipt, order number, name, e-mail, scope (whole order or items with quantities), the optional reason and the full text of the statement.

= Can I change the labels? =
Yes. Leave them empty to use the wording of the directive in the visitor's language, or enter your own.

= My shop uses custom order numbers. =
Use the `wdly_find_order` filter to return the order for a given number; Withdrawly then checks the e-mail address.

= What happens when I uninstall the plugin? =
Settings are removed. Withdrawal statements are kept as evidence, unless you define `WDLY_DELETE_REQUESTS` as true in wp-config.php before uninstalling.

== Screenshots ==

1. Step 1 – order lookup without an account.
2. Step 2 – choose the whole order or selected products, then confirm.
3. Confirmation page.
4. Withdrawal log in WooCommerce.
5. A withdrawal statement with processing status.

== Changelog ==

= 1.0.0 =
* First release.
