=== H1Design Contract Withdrawal for WooCommerce ===
Contributors: h1design
Tags: woocommerce, withdrawal, consumer protection, croatia, gdpr
Requires at least: 6.0
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

Adds a compliant contract withdrawal button to WooCommerce orders, as required by Croatian consumer protection law (effective 19 June 2026).

== Description ==

This plugin adds a clear, visible "withdraw from contract" function to a WooCommerce store, as required for distance contracts under Croatian consumer protection law (the amendments adopted on 29 May 2026, with the withdrawal-button obligation applying from 19 June 2026).

WooCommerce's built-in order cancellation is not the same as the legal right of withdrawal: cancellation is only available before an order is processed, while the right of withdrawal applies after delivery, within the statutory period. This plugin implements the latter.

= Key features =

* A "Withdraw from contract" button on each eligible order in My Account > Orders (logged-in customers).
* A guest flow: customers who checked out without an account enter their order number and e-mail, and receive a confirmation link (valid 60 minutes) sent to the order's e-mail address. This prevents anyone but the inbox owner from starting a withdrawal.
* A clean two-step confirmation (review, then confirm). No discouraging messages or hidden steps (no dark patterns).
* Automatic confirmation e-mail to the customer, with an exact timestamp (durable medium).
* Notification e-mail to the shop, with full request details and a link to the order.
* A request log in the admin area (WooCommerce > Withdrawal requests).
* Exemptions for products with no right of withdrawal (e.g. personalised or made-to-order goods), set per product, per variation, per category, or manually per order.
* Configurable trigger order status, withdrawal window length, optional buffer days, recipient e-mail, and exempt-product notice text.

= Important =

This plugin is a technical tool to help a store offer a withdrawal function. It does not constitute legal advice, and it does not by itself guarantee full legal compliance. Store owners remain responsible for their terms of sale, pre-contract information, and overall compliance. For the withdrawal window to be accurate, orders must be marked with the configured trigger status (default: Completed) after delivery.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install it through the WordPress "Add New" plugins screen.
2. Activate the plugin. WooCommerce must be installed and active.
3. Go to WooCommerce > Settings > Contract withdrawal to configure the trigger status, window length, buffer, recipient e-mail, and exempt-product notice.
4. Optionally mark products, variations, or categories as exempt from withdrawal under each product's data panel or the category screen.

== Frequently Asked Questions ==

= Does this replace WooCommerce order cancellation? =

No. Cancellation and the right of unilateral withdrawal are different. This plugin adds the legal withdrawal function, which applies after delivery within the statutory period.

= When does the withdrawal window start? =

From the moment an order reaches the configured trigger status (default: Completed). The plugin records that timestamp so the window does not drift if the order is edited later.

= Can guests (customers without an account) withdraw? =

Yes. They enter their order number and e-mail, then confirm via a link sent to the order's e-mail address.

= Does the plugin change the order status automatically? =

No. It records the request and notifies the shop. Processing the request (refunds, status changes) is done manually by the store.

= Is this legal advice? =

No. It is a technical tool. Store owners are responsible for their own legal compliance.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
