=== DevPixels EU Withdrawal Form for WooCommerce ===
Contributors: devpixels
Tags: woocommerce, withdrawal, consumer rights, gdpr, ecommerce
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Free EU withdrawal button & form with GDPR-compliant requests, guest verification, and 14-day legal check for WooCommerce.

== Description ==

DevPixels EU Withdrawal Form for WooCommerce adds a complete EU withdrawal request system to your WooCommerce store.

Customers can easily submit withdrawal requests for eligible orders, while store administrators can review, process, and manage requests from a dedicated WooCommerce dashboard.

The plugin supports both registered customers and guest orders, includes configurable legal information, category-based withdrawal rules, automatic withdrawal period validation, customer and administrator email notifications, and full compatibility with WooCommerce High-Performance Order Storage (HPOS).

== Features for Customers ==

* Displays a **Withdraw from contract** button on eligible WooCommerce orders.
* Button is automatically shown only while the configured withdrawal period is active.
* Supports both registered customers and guest orders.
* Secure guest verification using Order ID, Billing Email, and Withdrawal Token.
* Simple withdrawal request form.
* View withdrawal request status from the My Account order page.
* Withdrawal button in WooCommerce customer order emails.
* Configurable legal information displayed to customers.
* Checkout consent checkbox for digital or restricted product categories.
* Customer email notifications after submitting a withdrawal request.
* Withdrawal request form available anywhere using the included shortcode.

== Features for Store Owners ==

* Dedicated **Withdrawals** administration menu.
* Centralized **Requests** page for managing withdrawal requests.
* Approve or reject withdrawal requests.
* View request details and current status.
* Dashboard widget with recent withdrawal statistics.
* Configure the withdrawal period (default 14 days).
* Customize all customer-facing legal notices.
* Configure the Withdrawal Request page.
* Configure the Withdrawal Policy page.
* Configure category-based withdrawal rules.
* Define different customer messages for:
    * Standard products
    * Digital products
    * Article 16 excluded products
* Administrator email notifications for new withdrawal requests.
* Fully compatible with WooCommerce HPOS and Classic Order Storage.

== Key Features ==

* Automatic withdrawal eligibility validation.
* Configurable withdrawal period.
* Category-based withdrawal rules.
* Standard, Digital and Article 16 product support.
* Guest withdrawal verification workflow.
* Withdrawal request shortcode.
* WooCommerce My Account integration.
* WooCommerce customer email integration.
* Customer email notifications.
* Administrator email notifications.
* Dashboard statistics widget.
* Lightweight and optimized implementation.

== Settings ==

The plugin includes a centralized settings page where store owners can:

* Configure the withdrawal period.
* Customize legal information displayed to customers.
* Customize checkout consent messages.
* Select the Withdrawal Request page.
* Select the Withdrawal Policy page.
* Configure customer messages for standard, digital, and excluded products.
* Define withdrawal rules for every WooCommerce product category.

== EU Compliance ==

This plugin provides tools that can assist merchants in managing withdrawal requests under European consumer protection rules.

Included functionality supports common withdrawal workflows such as:

* Withdrawal period validation.
* Category-based withdrawal eligibility.
* Digital product restrictions.
* Customer withdrawal requests.
* Administrative request management.

Store owners remain responsible for ensuring their store complies with all applicable laws and regulations.

== Compatibility ==

* WooCommerce
* WooCommerce High-Performance Order Storage (HPOS)
* Classic WooCommerce Order Storage
* WordPress 6.4+
* PHP 7.4+

== Usage ==

=== Customer Withdrawal Button ===

The withdrawal button is automatically displayed on eligible WooCommerce orders when the configured withdrawal conditions are met.

=== Guest Withdrawal Form ===

Use the shortcode:

[wcwb_withdrawal]

Guest customers verify their order using:

* Order ID
* Billing Email
* Withdrawal Token - Received on the order detail email

This verification process helps prevent unauthorized withdrawal requests.

=== Administration ===

Navigate to:

Withdrawals → Requests

From the Requests page you can:

* View all withdrawal requests.
* Review request details.
* Approve requests.
* Reject requests.
* Track request status.

Plugin configuration is available under:

Withdrawals → Settings

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/` directory or install the plugin through the WordPress Plugins screen.
2. Activate the plugin.
3. Open **Withdrawals → Settings**.
4. Configure your withdrawal settings.
5. Create a page containing the `[wcwb_withdrawal]` shortcode for guest withdrawals if required.

== Frequently Asked Questions ==

= Does this plugin support WooCommerce HPOS? =

Yes. The plugin fully supports WooCommerce High-Performance Order Storage (HPOS).

= Can guest customers submit withdrawal requests? =

Yes. Guests can verify their order using the Order ID, Billing Email, and Withdrawal Token.

= Can I configure which products are eligible for withdrawal? =

Yes. Withdrawal eligibility can be configured independently for each WooCommerce product category.

= Are digital products supported? =

Yes. Digital products can have separate withdrawal rules and customer messages.

= Does the plugin send email notifications? =

Yes. Customers receive confirmation emails after submitting a withdrawal request, while administrators receive notifications about new withdrawal requests.

= Does this plugin process WooCommerce refunds? =

No. Withdrawal requests are managed independently from WooCommerce refunds.

== Screenshots ==

1. **Plugin General Settings (Settings)** - The configuration panel where store owners can set the withdrawal period, checkout consent texts, customer messages for digital or excluded products (Article 16), and category-based withdrawal rules.

2. **Withdrawal Requests Management (Backend)** - The administration screen where store owners can view all submitted withdrawal requests, their status (Pending, Confirmed, Rejected), customer reasons, and available approval or rejection actions.

3. **WooCommerce Order Details with Active Withdrawal Request** - The WooCommerce order edit screen showing withdrawal request information, unique withdrawal token, request status, and selected products.

4. **Checkout Consent Checkbox** - Integration of a required checkbox during checkout where customers acknowledge withdrawal exceptions for specific product types.

5. **Withdrawal Token Section on Order Thank You Page** - Displays legal information and the unique Withdrawal Reference Token after order placement, especially useful for guest customers.

6. **Guest Withdrawal Form** - Public withdrawal request page where guest customers can enter their order number, email address, and withdrawal token to verify the order and submit a withdrawal request.

7. **WordPress Dashboard Monitoring Widget** - A quick overview widget in the WordPress administration dashboard displaying current pending, confirmed, and rejected withdrawal requests.

8. **Customer Account Order History (My Account)** - The WooCommerce customer account order list showing a visual withdrawal request status label for each order.

9. **Withdrawal Button in My Account Order Details** - A dedicated customer action inside the order details page allowing customers to start the withdrawal process with an informational message and withdrawal button.

10. **Inline Withdrawal Form in Customer Account** - The customer interface for selecting products, choosing the withdrawal type (full or partial), and adding an optional reason without leaving the order page.

11. **Withdrawal Request History in Customer Account** - Overview section inside the WooCommerce "My Account" Orders page where each order displays a visual status label based on the current withdrawal request status (CONFIRMED, PENDING, REJECTED).

12. **Email Notification: Withdrawal Request Received** - Automatic email template sent to customers after submitting a withdrawal request, containing transaction details, the generated withdrawal token, and information about the next steps.

13. **Email Notification: Withdrawal Request Approved** - Confirmation email sent to customers when an administrator approves a withdrawal request, with support for adding a custom administrator note such as return instructions or shipping information.

14. **Email Notification: Withdrawal Request Rejected** - Automatic email sent when a withdrawal request is rejected, clearly displaying the rejection reason provided by the administrator (for example, customized products made according to customer specifications that are excluded from withdrawal).

== Changelog ==

= 1.0.0 =

* Initial public release.
* Withdrawal request management.
* Guest withdrawal verification.
* Category-based withdrawal rules.
* Configurable legal notices.
* Withdrawal settings page.
* WooCommerce My Account integration.
* WooCommerce customer email integration.
* Customer email notifications.
* Administrator email notifications.
* Dashboard statistics widget.
* WooCommerce HPOS compatibility.

== Upgrade Notice ==

= 1.0.0 =

Initial public release.