=== Quick Order for WooCommerce ===
Contributors: catcodestudio
Tags: woocommerce, quick order, one click buy, buy now, 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

A "Buy in 1 click" button for WooCommerce: the shopper leaves a name and a phone number, the shop gets a real order.

== Description ==

A full WooCommerce checkout asks for a dozen fields. Plenty of shoppers — especially on mobile — never finish it. This plugin adds a **Buy in 1 click** button next to "Add to cart": a small modal asks for a name and a phone number, and the shop immediately gets a real WooCommerce order that the manager confirms by phone.

Nothing is faked: the order is created through `wc_create_order()`, contains the chosen product with its quantity and variation, gets the status you configure, and opens in WooCommerce → Orders like any other order. The payment method is a pseudo method called "Manager call" — no gateway is involved.

= Free features =

* "Buy in 1 click" button on the product page, optionally in the catalogue loop as well
* Compact modal with two required fields: name and phone
* Ukrainian phone validation and normalisation to the `+380XXXXXXXXX` form
* Anti-spam: nonce, honeypot field, submit-time trap and a per-IP rate limit
* A real WooCommerce order with the status you choose and a configurable payment method title
* Notification e-mail to the manager with the contact details and the ordered items
* Editable button, modal, field and success texts
* Choice between an in-modal confirmation and a redirect to the thank-you page
* Request log with the last submissions and their result
* HPOS (custom order tables) compatible; no jQuery and no external CDN

= Pro features =

* Extra modal fields: e-mail, city and comment, each optional or required
* Ukrainian phone input mask
* "Whole cart in 1 click" — a button on the cart page that turns every cart line into one order
* UTM tags and the referrer stored in the order meta
* Per-minute IP limit and a phone-number blacklist
* Request duplicated into Telegram and to additional e-mail recipients

A fresh install is simply the free tier — nothing switches Pro on by itself. The Pro settings stay visible where they belong, greyed out and marked `Pro`, with one line explaining what each group buys you. If you want to see them working, the settings screen has a **Try Pro for 7 days** button: you enter an e-mail, we issue a real 7-day licence key, send it to that address and unlock Pro right away. No card, no charge, one trial per install. When it ends the free tier keeps working exactly as before, your Pro settings are kept untouched, and a purchased key unlocks them again.

= Requirements =

* WooCommerce 6.0 or newer
* WordPress 6.2 or newer
* PHP 7.4+

The plugin interface is fully translated into Ukrainian. / Інтерфейс плагіна повністю перекладено українською.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/quick-order-for-woocommerce/`
2. Activate it in the "Plugins" menu
3. Go to WooCommerce → Купівля в 1 клік and set the texts, the order status and the notification address

== Frequently Asked Questions ==

= Is the order a real WooCommerce order? =

Yes. It is created with `wc_create_order()`, carries the product line items, the customer name in the billing first/last name fields and the number in the billing phone field, and behaves like any other order — including stock reduction and status e-mails.

= Which phone formats are accepted? =

`0XXXXXXXXX`, `380XXXXXXXXX` and `+380XXXXXXXXX`, with or without spaces, dashes and brackets. Everything is normalised to `+380XXXXXXXXX`. Shops selling abroad can widen this through the `ccqo_normalize_phone` filter.

= Does the button work with variable products? =

On the product page, yes — the plugin picks up the variation the shopper selected. In the catalogue loop the button is only shown for simple products, because a variation cannot be chosen there.

= How is spam prevented? =

Four independent layers: a nonce, a honeypot field, a minimum fill-in time and a per-IP rate limit (per hour in the free tier, plus per minute in Pro). Pro also adds a phone blacklist.

= Does it work with HPOS / custom order tables? =

Yes, compatibility is declared for both `custom_order_tables` and `cart_checkout_blocks`.

== Screenshots ==

1. The "Buy in 1 click" button on the product page
2. The quick order modal
3. Plugin settings
4. The created order in WooCommerce

== Changelog ==

= 1.1.0 =
* Changed: the Pro trial no longer starts by itself. A fresh install is the free tier until you press "Try Pro for 7 days" in the settings — that issues a real 7-day licence key to your e-mail and unlocks Pro on the spot.
* Changed: licence keys are now verified against catcode.com.ua — activate, release and a daily re-check, with a 14-day offline grace period if our server is unreachable. A key belonging to another CatCode product is rejected instead of silently unlocking Pro.
* Changed: Pro settings stay on screen greyed out with a `Pro` badge and a line explaining what they buy you, instead of being hidden.
* Changed: one single notice, shown after the first quick order is actually created — not on activation. Dismiss it once and it never comes back.
* Changed: saving the settings screen now merges into what is already stored instead of rewriting the whole option, so the licence cache and the trial marker — which live outside the form — survive a save.

= 1.0.4 =
* Fixed: the order screen showed the raw method id ("ccqo_call") instead of the configured payment title.
* Fixed: the currency symbol reached the manager's e-mail and the Telegram message as a raw HTML entity.

= 1.0.3 =
* Fixed: the "Whole cart in 1 click" button never appeared on the block-based cart page.

= 1.0.2 =
* Fixed: the modal did not open when the storefront printed the footer scripts before the modal markup.
* Fixed: the phone mask mangled numbers typed in the national 0XX format, and the caret could land in front of the "+380" prefix.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
The 7-day Pro trial no longer starts on its own — press "Try Pro for 7 days" in the settings when you want it. Licence keys are now checked against catcode.com.ua.

= 1.0.0 =
Initial release.
