=== UA Legal Pack for WooCommerce ===
Contributors: catcodestudio
Tags: woocommerce, cookie consent, privacy policy, terms, checkout
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ukrainian legal pages, a cookie banner that really blocks scripts, and a checkout consent that leaves an evidence record.

== Description ==

The legal minimum a Ukrainian online shop has to publish, produced from a single form. The plugin generates four documents, puts up a cookie banner that actually blocks the counters, and adds a checkout consent that leaves a record you can produce as evidence. No third-party services and no outbound requests.

This is the WooCommerce build of the CatCode `cc_legal` module for OpenCart: the same questionnaire, the same document templates, the same Free/Pro split.

**Important disclaimer.** The plugin generates document **drafts** with your own company details filled in. This is not legal advice and not a guarantee of compliance. Have the texts reviewed by a lawyer before publishing them, and fill in the gaps highlighted in yellow — the plugin makes them deliberately loud so that an unfinished document never looks finished.

= The documents =

The texts are written in Ukrainian and follow the Ukrainian laws "On Consumer Rights Protection", "On Electronic Commerce" and "On Personal Data Protection", plus the Civil Code articles on public contracts. The documents are not translated: a Ukrainian consumer text in English carries no legal weight — the interface is bilingual, the documents are not.

* Public offer (public contract)
* Return and exchange terms
* Privacy and personal data processing policy
* Delivery and payment terms

= Free features =

* Seller questionnaire: legal form, legal name, EDRPOU/RNOKPP, state register entry, address, contacts, signatory, bank details, VAT status.
* Commercial terms: delivery and payment methods, dispatch time, free-shipping threshold, return windows, warranty and refund rules.
* Pages are created as ordinary WordPress pages and stay fully editable.
* "Overwrite existing text" is off by default — your manual edits survive a second generation run.
* **Document versioning:** any change to a text, whether made by the generator or by hand in the editor, raises the version and archives the previous revision.
* Cookie banner: three categories (necessary / analytics / marketing), "Accept all" / "Decline" / "Customise" buttons, bar or box layout, four positions, your own colours, your own copy in Ukrainian and English, and the choice is remembered.
* **Real script blocking:** GA4, GTM, Meta Pixel, TikTok, Hotjar, Clarity, Matomo and others are rewritten to `type="text/plain"` and never run until the visitor consents. After consent they start without a page reload. Custom domains are added as a comma-separated list.
* Consent checkbox in both the **classic** and the **block** checkout (Store API), linking to the generated documents.
* The "required" mode can be switched off — the checkout then behaves exactly as it would without the plugin.
* Evidence record on the order: who agreed, when, from which IP, with which **revision** of every document, plus a record number.
* Consent journal (checkout and cookie choices, declines included) with filters and search — the latest 100 rows.
* Compatible with HPOS (custom order tables) and the block checkout.

= Pro features =

* Consent journal with no row limit.
* CSV export of the journal for inspections and disputes.
* Document revision archive: open the exact text the customer agreed to.

A fresh install is plain free — nothing Pro switches itself on. The 7-day trial starts only when you click "Try Pro for 7 days" and enter an e-mail: the server issues a real 7-day key and sends it to you. When it ends, document generation, the cookie banner and the checkout consent keep working, and no consent record is ever deleted — the journal is evidence. Licences are issued for a term of 1 to 5 years.

= Requirements =

* WooCommerce 7.0 or newer (block checkout consent needs WooCommerce 8.9+)
* PHP 7.4+

The plugin interface is fully translated into Ukrainian, and the generated documents are Ukrainian by design. / Інтерфейс плагіна повністю перекладено українською.

== Installation ==

1. Upload the plugin and activate it.
2. Open WooCommerce → "UA-юрпакет".
3. Fill in the seller details and the commercial terms, then save.
4. Press "Create / update pages".
5. Open the generated pages, fill in the spots highlighted in yellow and have a lawyer review the texts.
6. Configure the cookie banner and the checkout consent if you need them.

== Frequently Asked Questions ==

= Can I publish the generated documents as they are? =

No. They are drafts. Missing details are highlighted in yellow right in the text, and the whole document should be reviewed by a lawyer.

= Will "Create / update pages" overwrite my edits? =

No, unless "Overwrite existing text" is enabled. By default an existing page is left untouched.

= Why version the documents? =

So that a consent is actual proof. Every journal row stores the revision number of each document at the moment of the consent, and the archive lets you open the exact text that was published back then.

= Does the consent checkbox work in the block checkout? =

Yes. It is registered through the Additional Checkout Fields API, so WooCommerce renders it and enforces the required flag both on the client and in the Store API. WooCommerce 8.9 or newer is needed.

= How do I block Google Analytics until consent is given? =

Nothing to do: blocking of the analytics category is on in the cookie settings, and the plugin rewrites the well-known counters to `type="text/plain"` by itself. A non-standard script is added by its domain under "Extra analytics markers".

= Why does the journal show only 100 rows? =

That is the free tier. Nothing is deleted — the remaining rows become visible again once a licence key is entered.

= What is removed when the plugin is deleted? =

Only the settings. The generated pages stay (they are site content), and so do the consent journal and the revision archive — those records prove the fact and the content of each consent. If you want them gone, export the journal to CSV and drop the `{prefix}cclg_consent`, `{prefix}cclg_document` and `{prefix}cclg_doc_version` tables by hand.

== Screenshots ==

1. Seller questionnaire and the state of the generated documents.
2. Cookie banner settings: layout, colours, script blocking.
3. The cookie banner on the storefront with the category panel.
4. The consent checkbox in the checkout and the evidence record on the order.
5. The consent journal and the document revision archive.

== Changelog ==

= 1.1.0 =
* The Pro trial no longer starts by itself. A fresh install is plain free; the 7-day trial begins only when the shop owner clicks "Try Pro for 7 days" and enters an e-mail — the licence server then issues a real 7-day key and mails it.
* Licence keys are now verified against the CatCode licence server (activate on save, re-verify daily, 14-day offline grace) instead of being checked offline by their shape.
* "Release licence" frees the key from this site so it can be used on another shop.
* One dismissible notice instead of the recurring trial banner — and it only appears after the pack has actually done something (documents generated or the first consent recorded). Dismiss it once and it never comes back.
* Pro features stay visible where they live, greyed out with a Pro badge and a line explaining what they give.
* Fixed: the consent journal screen loaded no stylesheet at all, so its tiles, badges and toolbar were unstyled.
* Fixed: saving the settings form no longer wipes a licence key that was just activated.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
The Pro trial no longer starts on its own — it begins only when you ask for it, and it now issues a real key. If you already own a licence key, it is re-checked against our server automatically on the first admin page load.

= 1.0.0 =
Initial release.
