=== Pay4All Shop — Simple order forms for products or events using TWINT Payment ===
Contributors: pay4all
Tags: order form, products, payments, twint, woocommerce twint
Requires at least: 5.9
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

🚀 Order forms with batch pricing (wine by box of 6), event ticketing with QR validation, deliveries, Twint with Pay4All Pro — no WooCommerce required.

== Description ==

**Pay4All Shop** is a simple, focused order-form plugin for small shops, wineries, caterers, takeaways and clubs. It is intentionally lighter than WooCommerce: you create a form, pick products and delivery methods, and embed it via a shortcode.

= Core features =

* Drag-and-drop **form builder** with all common field types — default fields (first name, last name, e-mail, phone, address, etc.) are pre-translated in every activated language
* **Products** with photo, price, sale price, min/max/step quantities, short description
* **Three product types** — *Physical* (default), *Virtual* (downloadable file delivered after purchase), *Ticket* (one QR code per seat, sent in the order email)
* **Out-of-stock flag** — the product stays visible in the form but the quantity field is greyed out and disabled
* **Categories with quantity rules** — including *minimum + multiple* (e.g. wine sold by carton of 6, you can mix varieties as long as the total is 6, 12, 18…)
* **Delivery methods** — pickup, flat-rate, free, free over an amount, or no delivery; **accepted payment methods are set per delivery** so each delivery can expose its own payment choices to the customer
* **Per-delivery customer-facing title and description** in every activated language
* **Tickets admin page** — list every QR ticket, search by first/last name / city / e-mail, validate manually, export to CSV
* **Public ticket validation page** — the organizer scans the QR with any smartphone; the page shows a green *Validate* button if the seat is still available, or a red message with the date of the previous scan if already used
* **Virtual file delivery** — the file is stored in a private folder (`.htaccess` protected), the customer receives a one-time link valid for 60 days, served by the plugin's download endpoint
* **Order management** — custom statuses, payment statuses, internal notes
* **E-mails** to the customer and the merchant — full content (subject, heading, intro, outro) editable per language
* **CSV export** of orders, filterable by date, form, status
* **Privacy API integration** for GDPR export/erase
* Honeypot anti-spam, nonces, server-side validation
* Internationalised (FR, DE, IT, EN)

= Payments included for free =

* Pickup payment
* Cash on delivery
* Bank transfer with IBAN details
* TWINT manual (textual instructions to the customer)

= Pay4All Pro (optional) =

Install **[Pay4All Pro](https://pay4all.ch/)** to add **automated TWINT payments**: the customer pays through their TWINT app at checkout, and the order is marked as Paid automatically without merchant intervention.

Pay4All Shop works fully without Pay4All Pro. Pay4All Pro is sold separately at https://pay4all.ch/.

= External services =

When you sell a **ticket** product, the order confirmation email contains a QR code per seat. The QR image is rendered by the customer's email client (or browser when previewing) from `https://api.qrserver.com/v1/create-qr-code/`. The plugin server itself does not call this service — the request is made by the recipient when they open the email. The data passed to the service is only the ticket validation URL (your site domain + a random per-seat token).

Terms of service: https://goqr.me/api/
Privacy: https://goqr.me/api/#privacy

= Use cases =

* Winemakers selling by carton of 6
* Cheese makers selling by half-wheel
* Caterers with weekly order windows
* Local shops with pickup-only ordering
* Clubs taking online registrations with payment
* Concert organizers selling tickets with QR codes scanned at the door
* Digital sellers delivering PDFs, mp3s or course material as virtual products

== Installation ==

1. Upload the plugin to `/wp-content/plugins/pay4all-form/` or install via *Plugins › Add New*.
2. Activate the plugin from the *Plugins* menu.
3. Open *Pay4All Shop* in the admin sidebar.
4. Create your categories, products, delivery methods, then a form.
5. Copy the form shortcode into any page.

== Frequently Asked Questions ==

= Do I need WooCommerce? =

No. Pay4All Shop is standalone. It does not depend on WooCommerce in any way.

= Can I sell wine by carton of 6, but let the customer mix varieties? =

Yes — this is the core use case. Set the category to *Minimum + multiple*, with minimum 6 and multiple 6. The customer can pick any combination of bottles from that category as long as the total is 6, 12, 18, etc.

= Does it support online payments? =

The free version supports manual payments only (pickup, on delivery, bank transfer, TWINT instructions). Automated TWINT payments are available via Pay4All Pro.

= Is the plugin GDPR-friendly? =

Yes. Customer data is included in WordPress's *Tools › Export / Erase Personal Data* workflow.

= Will my data be deleted if I uninstall? =

No, unless you explicitly enable *Réglages › Données › Supprimer les données lors de la désinstallation*.

= How do tickets work? =

When you create a product of type *Ticket* and a customer orders N seats, the plugin generates N unique QR codes — one per seat. Each QR points to a public validation URL (`/p4all-ticket/{slug}/{token}`). The customer receives one e-mail with every QR embedded. At the door, the organizer scans a QR: the page shows a green *Validate* button when the ticket is still available, and a red message with the date of the previous scan if it has already been used. You can also validate tickets manually and search them by customer information from *Pay4All Shop › Billets*.

= How do virtual products work? =

When you create a product of type *Virtual*, you upload one file per product. The file is stored in `wp-content/uploads/p4all-virtual/`, protected by an automatically generated `.htaccess` (deny from all). After purchase, the customer's e-mail contains a one-time download link served by the plugin endpoint (`?p4all_dl={token}`). The link is valid for 60 days.

= How does *Out of stock* work? =

Tick the *Rupture de stock* checkbox on a product. The product stays visible in the form so the customer still sees what you usually offer, but the quantity field is greyed and disabled. A red badge labels the product as out of stock. Server-side validation rejects any tampered submission that tries to order an out-of-stock item.

== Screenshots ==

1. Example of an order form and delivery options.
2. Payment method selection, confirmation and payment via TWINT.
3. Dashboard, order list and language selection.
4. Configure rules linked to a category and add a product.
5. Order form configuration.

== Changelog ==

= 1.1.0 =
* New product type **Virtual** — upload one downloadable file per product, customer receives a one-time link valid 60 days, served by the plugin's protected endpoint (files stored in a private folder with deny-all `.htaccess`).
* New product type **Ticket** — one QR code per seat ordered, sent in the order email, scannable from any smartphone, with a public validation page showing green (available) or red (already used).
* New admin page *Pay4All Shop › Billets* — list every QR ticket, search by first/last name / city / e-mail, validate manually, export to CSV.
* **Out of stock** flag on every product — product stays visible, quantity field is greyed and disabled, server-side rejects tampered orders.
* **Default form fields** (first name, last name, e-mail, phone, address, etc.) are now pre-translated in every activated language at form creation time.
* **Per-delivery payment methods** — accepted payment methods are now configured per delivery method (a delivery edit screen has a *Modes de paiement acceptés* section), so each delivery can show its own payment choices to the customer. Forms without any delivery still use the legacy per-form payment picker.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==



= 1.1.2 =
Change name plugin and order menu

= 1.1.0 =
Adds ticket QR codes, virtual file downloads, out-of-stock flag, per-delivery payment methods and pre-translated default fields. Please deactivate and reactivate the plugin once after upgrading so the new `wp_p4all_tickets` table and the `/p4all-ticket/...` rewrite rule are installed.

= 1.0.0 =
First public release.
