=== WebToffee EU Customer Withdrawal Button for WooCommerce ===
Contributors: webtoffee
Tags: woocommerce, EU withdrawal, right of withdrawal, EU compliance, EU directive
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
WC requires at least: 7.0
WC tested up to: 10.8.1
Stable tag: 1.0.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Add a legally compliant EU withdrawal button to your WooCommerce store. It allows customers to exercise their 14-day right of withdrawal online.

== Description ==

From June 19, 2026, EU Directive 2023/2673 requires every online store selling to EU consumers to provide a clear, easily accessible online withdrawal function. Customers must be able to cancel a purchase digitally — just as easily as they placed the order.

**EU Withdrawal Button for WooCommerce** by WebToffee makes it straightforward to comply. The plugin adds a withdrawal button to the customer's My Account orders page, a guided withdrawal form, a two-step confirmation flow, and a dedicated admin dashboard to manage all incoming requests.

No coding required. Works right out of the box.

= What the plugin does =

**For your customers:**

* A "Request Withdrawal" button appears directly on the My Account orders list — visible only during the active withdrawal period
* Customers can select which items to withdraw (full order or individual products)
* A simple form collects their name, email, and an optional reason
* A confirmation step prevents accidental submissions ("Are you sure you want to submit this withdrawal request?")
* Customers receive an email confirmation once the request is submitted

**For you as the store admin:**

* A clean Withdrawals dashboard under WooCommerce > Withdrawals shows all requests at a glance
* At-a-glance stats: open requests and approvals over the last 30 days
* Filter requests by status, date range, or order number
* View full request details — order info, customer email, request type, reason, and a complete activity log
* Approve or reject requests with one click

= Key features =

* **Withdrawal button on the orders page** — visible to customers within the configured withdrawal window
* **Partial withdrawal support** — customers can withdraw individual items instead of the entire order
* **Two-step confirmation flow** — meets the directive's requirement to confirm the customer's intent
* **Dedicated admin dashboard** — manage, filter, approve, or reject all withdrawal requests in one place
* **Automatic footer link** — optionally embed a withdrawal link in your store footer to meet visibility requirements
* **Configurable withdrawal period** — set the window to 2, 7, 14, or 30 days (EU standard is 14 days)
* **Product exclusions** — exclude virtual, downloadable, grouped, or external/affiliate products from withdrawal eligibility
* **Order status automation** — automatically update order status when a request is submitted or approved
* **Reason field** — optionally require customers to provide a reason when submitting a request
* **Display scope control** — show the withdrawal form globally or limit it to WooCommerce pages only
* **Data management** — optionally delete all plugin data on uninstall

= Why this matters =

Under [EU Directive 2023/2673](https://eur-lex.europa.eu/eli/dir/2023/2673/oj/eng), any business that lets EU consumers sign up for or purchase something online must also let them cancel online — through the same website or app. Simply hiding a withdrawal form in a footer PDF or asking customers to email you is no longer sufficient.

The directive specifically requires:

* A withdrawal function that is **prominently displayed** and **continuously available** during the withdrawal period
* The function must be **clearly labelled** (e.g. "Withdraw from contract here" or similar)
* A **two-step confirmation** to prevent accidental withdrawals
* An **acknowledgement of receipt** sent to the customer on a durable medium (e.g. email)

This plugin implements all of the above.

= Getting started =

1. Install and activate the plugin
2. Go to **WooCommerce > Withdrawals > Settings** to configure your preferences
3. Set your withdrawal page, period, and footer link options
4. Publish the withdrawal page (created automatically as a draft on installation)
5. Test the flow by placing a test order and using the Request Withdrawal button

= Support =

For questions or assistance, visit our [support page](https://wordpress.org/support/plugin/eu-withdrawal-button/).

== Installation ==

= Automatic Installation (Recommended) =

1. Log in to your WordPress admin
2. Go to **Plugins > Add New**
3. Search for **EU Withdrawal Button for WooCommerce**
4. Click **Install Now**, then **Activate**
5. Navigate to **WooCommerce > Withdrawals > Settings** to configure the plugin

= Manual Installation =

1. Download the plugin zip file
2. Go to **Plugins > Add New > Upload Plugin**
3. Upload the zip file and click **Install Now**
4. Activate the plugin
5. Navigate to **WooCommerce > Withdrawals > Settings** to get started

== Frequently Asked Questions ==

= Is this plugin required for all WooCommerce stores? =

If your store sells to consumers in the EU, yes — from June 19, 2026, EU Directive 2023/2673 requires an accessible online withdrawal function. This applies regardless of where your business is based.

= What is the standard withdrawal period? =

The EU standard is 14 calendar days from the date of purchase (or from when the customer receives the pre-contractual information, if later). You can configure the withdrawal period in the plugin settings.

= Can customers withdraw only part of an order? =

Yes. When partial withdrawals are enabled in settings, customers can select individual items from an order to withdraw rather than cancelling the entire order.

= Does the plugin work for guest customers? =

The withdrawal button on the My Account page is visible to logged-in customers. For guest order support, you can direct customers to the standalone withdrawal page using the footer link or a shortcode.

= Where does the withdrawal button appear? =

The "Request Withdrawal" button appears on the customer's My Account > Orders page, next to eligible orders within the active withdrawal window.

= How do I add the withdrawal link to my store footer? =

Go to **WooCommerce > Withdrawals > Settings** and enable the **Embed footer link** option. You can customise the link text (default: "Request Withdrawal").

= Can I exclude certain product types? =

Yes. Under the Exclusions section in settings, you can exclude Virtual, Downloadable, Grouped, and External/Affiliate products from withdrawal eligibility.

= Does the plugin send a confirmation email to customers? =

Yes. Customers receive an email confirmation once their withdrawal request is submitted. This satisfies the directive's requirement to acknowledge receipt on a durable medium.

= What happens to the data if I uninstall the plugin? =

By default, plugin data is retained when you uninstall. If you want all data (settings, withdrawal requests, database tables) removed on uninstall, enable the **Delete data on uninstall** option in settings. Note: this action is irreversible.

= Does this plugin guarantee legal compliance? =

The plugin implements the technical requirements of EU Directive 2023/2673 as understood at the time of release. However, it does not constitute legal advice. We recommend consulting a legal professional to ensure your store meets all applicable requirements in your jurisdiction.

== Screenshots ==
1. Withdrawal request form
2. Withdrawal request details
3. EU Withdrawal Button Plugin settings
4. Admin withdrawals dashboard

== Changelog ==

== Upgrade Notice ==

== Changelog ==

= 1.0.0 =
* Initial release.
* Customer withdrawal form (logged-in and guest).
* React admin dashboard for request management.
* Custom order statuses: Pending Withdrawal, Withdrawn.
* WooCommerce Settings tab integration.
* Product type based exclusions.
* Configurable withdrawal period.
* WooCommerce email notifications.
* HPOS compatibility.
* REST API.
* My Account integration.

== Upgrade Notice ==
