=== 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.1
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 admin page in the WordPress 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).

The plugin is compatible with both WooCommerce Classic Checkout and the new WooCommerce Checkout Blocks, providing withdrawal consent handling for both checkout experiences.

== 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.

== Translation Ready ==

The plugin is fully translation ready and supports WordPress localization standards.

Included translations:

* French (FR)
* German (DE)
* Spanish (ES)
* Italian (IT)
* Bulgarian (BG)

The plugin includes translation files (.po and .mo) for supported languages. Additional translations can be provided through the WordPress translation platform.


== EU Compliance ==

This plugin provides tools to help WooCommerce merchants manage customer withdrawal requests in accordance with European consumer protection requirements.

Included functionality supports common withdrawal workflows, including:

* Withdrawal period validation.
* Category-based withdrawal eligibility rules.
* Digital product withdrawal restrictions.
* Article 16 exception handling.
* Customer withdrawal requests.
* Administrative request management.
* Withdrawal consent collection during checkout.

Store owners are responsible for configuring the plugin correctly and ensuring that their store complies with all applicable laws, regulations, and consumer protection requirements.

== Compatibility ==

* WooCommerce
* WooCommerce High-Performance Order Storage (HPOS)
* Classic WooCommerce Order Storage
* WooCommerce Classic Checkout
* WooCommerce Checkout Blocks
* 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. [Settings Page] - The main configuration panel where you can define the withdrawal period, legal notices, custom checkout texts, and withdrawal rules for each WooCommerce product category.

2. [Withdrawal Requests Management] - The administrator dashboard for managing all withdrawal requests. It provides a centralized overview of every request, allowing you to quickly review request details, status (Pending, Confirmed, Rejected), and perform management actions for each order.

3. [My Account – Orders List] - The customer's order history page, displaying all orders along with the current withdrawal request status for each order.

4. [Order Details – Withdrawal Button] - The order details page in the customer's account, where the "Withdraw from Contract" button is displayed, providing quick access to initiate the withdrawal process.

5. [Withdrawal Request Form] - An intuitive form that allows customers to select the products they wish to withdraw from the contract and optionally provide a reason for their request.

6. [Checkout Consent] - Checkout page integration that requires customers to acknowledge the withdrawal policy, ensuring compliance with Article 16 of Directive 2011/83/EU.

7. [Order Received – Confirmation] - The order confirmation page informing customers about their right of withdrawal and providing direct access to the withdrawal request form.

8. [Right of Withdrawal Details] - A dedicated section within the customer's order details email displaying the unique withdrawal reference code (token) required to identify and process the withdrawal request.

9. [Admin Edit Order View] - The WooCommerce order edit screen, where administrators can view the withdrawal request status associated with a customer's order.

10. [Standalone Withdrawal Form] - A standalone withdrawal request form embedded via shortcode on a dedicated page, allowing customers to verify the eligibility of an order using the order number and withdrawal token.

11. [Admin Dashboard Widget] - An informative WordPress Dashboard widget providing a quick overview of withdrawal request statuses (Pending, Confirmed, Rejected), with direct access to request management.

12. [Product Selection Interface] - The detailed product selection interface within the withdrawal request form, allowing customers to choose specific products (when applicable) for a partial withdrawal, while clearly displaying information about their legal withdrawal rights.

13. [Email Notification – Request Received] - An automated email template sent to customers confirming that their withdrawal request has been received, including the request details and the next steps in the review process.

14. [Email Notification – Request Approved] - An automated email template notifying customers that their withdrawal request has been approved, including any specific instructions provided by the store administrator.

15. [Email Notification – Request Rejected] - An automated email template sent when a withdrawal request has been rejected, providing the official reason for the decision along with a direct link to the store's Refund and Returns Policy.

16. [Withdrawal Request Approval] - The approval interface displayed when confirming a customer's withdrawal request. Administrators can add a personalized processing note, which is automatically included in the approval email, before finalizing the request.

== Changelog ==

= 1.0.1 =
* Added improvements for withdrawal request management.
* Improved WooCommerce order integration.
* Fixed minor admin interface issues.

= 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.