=== Paper Companions Core ===
Contributors: markdavidgan
Tags: woocommerce, pay what you want, digital downloads, blocks, printables
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
Requires Plugins: woocommerce
WC requires at least: 9.0
WC tested up to: 11.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Store logic for Paper Companions, a small WooCommerce shop of printable companions to the iPhone apps Return and Near.

== Description ==

Paper Companions Core holds everything about the store that is behaviour rather than presentation. The matching block theme, Paper Companions, handles the look.

* **Paper companion product data tab.** Companion app, format, page count, paper sizes and print notes, saved as product meta with a nonce and a per-product capability check.
* **Pay what you want.** Choose it per product, with a minimum and up to five suggested amounts shown as one-tap chips. The price field sits inside the add-to-cart form and has a proper label and help text. The amount is validated on add to cart, applied to the server-side cart, and shown in the classic and block Cart and Checkout. The price reads "Free, or pay what you want".
* **Free order flow.** Orders made up only of downloadable items complete as soon as they are paid, or straight away when the total is $0. The order-received page lists the downloads.
* **Demo gateway.** "Demo checkout — no money is taken" completes an order without charging anything. It is available only while the `paper_companions_demo` option is on, and it works in both the classic and block checkout.
* **Three server-rendered blocks.** Companion app, Print notes and Shelf intro. Each has a `block.json` (apiVersion 3), a `render.php`, and a small plain-JavaScript editor preview built on `ServerSideRender`. There is no build step.
* **Store API and REST.** Products gain `extensions.paper-companions` in `wc/store/v1` and `paper_companion` in `wc/v3`. Cart items carry the chosen PWYW amount.
* **Idempotent seeder.** `wp paper-companions seed`, or `\PaperCompanions\Core\seed()` from a Playground blueprint. It builds the whole catalog from `seed/catalog.json`.

The plugin declares compatibility with High-Performance Order Storage and with the Cart and Checkout blocks.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the `paper-companions-core` folder to `/wp-content/plugins/` and activate it.
3. Optional: run `wp paper-companions seed` to create the catalog. Add `--asset-base=<url>` to fetch images and files from somewhere other than https://companions.markdavidgan.com.
4. Optional, for demos only: `wp option update paper_companions_demo yes` turns on the demo gateway.

== Frequently Asked Questions ==

= Does the demo gateway take payments? =

No. It marks the order paid without contacting any payment provider. It is only registered while `paper_companions_demo` is `yes`. Never enable it on a store that takes real orders.

= Can a customer pay less than the minimum? =

No. The amount is checked on the server when the product is added to the cart, and the price is set on the server before totals are calculated. Whatever the browser sends is re-validated.

= Does pay what you want work with the Cart and Checkout blocks? =

Yes. The amount is stored as cart item data, so the Store API cart that powers the blocks sees the same price as the classic cart.

= What happens to seeded content when I uninstall? =

Only the plugin's options are removed. Products, pages and files are store content, and they stay.

== Changelog ==

= 1.0.0 =
* First release.
