=== Print.App Product Options for WooCommerce ===
Contributors: printapp
Tags: woocommerce, product options, printing, web-to-print, price calculator
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.4.15
License: MIT
License URI: https://opensource.org/licenses/MIT

Print product options with live pricing and artwork upload for WooCommerce — built for print shops.

== Description ==

Print Options renders a fast, accessible configurator on your product pages:

* Visual builder with print-ready templates (business cards, stickers with
  area pricing, t-shirt size × color matrices, posters, …) — right inside
  your WordPress admin, no JSON anywhere
* Live price preview: per-unit, per-page, per-area, quantity breaks
  (flat or graduated), setup fees, minimum orders
* Conditional options, multi-select finishes, and artwork upload
* Prices are ALWAYS re-verified server-side before an item enters the cart —
  the browser price is never trusted.

Create your option sets on the Print Options page, then open any product and
pick a set from its Print Options tab — next to Attributes and Variations.
Editing a set later updates every product that uses it.

Requires WooCommerce.

== Installation ==

1. Upload and activate the plugin.
2. Open Print Options → Option Sets in your admin sidebar and create an option
   set from a template.
3. Edit a product, open its Print Options tab, and pick the set from the
   dropdown. Done — the product page now shows the configurator.

== External Services ==

This plugin connects to the Print.App options service to do its job. No
customer account is required and no personal data is sold or shared.

**api.print.app** (Print.App API)

* *Price verification* — when a customer adds a configured product to the
  cart, the selected options and the product's option set are sent
  server-to-server so the price can be recomputed independently of the
  browser. No customer names, emails or addresses are transmitted.
* *Artwork upload* — when a customer uploads a file, the browser requests a
  one-time upload authorization. The file itself goes directly to storage
  and is automatically deleted after 30 days.
* *Option set management* — when a shop manager saves or assigns option
  sets, the set definition is stored under an anonymous store identifier
  (a random ID generated at activation; your site URL host is recorded as
  metadata only).

**options.print.app** (Print.App CDN)

* Published option sets are served from this domain to your product pages
  via your server (cached locally for 60 seconds). The visual builder itself
  is not loaded from here — it ships with the plugin and runs on your site.

These services are operated by Print.App ApS: https://print.app/
Privacy policy: https://print.app/company/privacy
Terms of service: https://print.app/company/terms

**cdn.filecheck.io** (Filecheck artwork preflight — optional)

Only used if you enter a Filecheck publishable key in the plugin settings.
Leave that field empty and this service is never contacted.

* *When it loads* — with a key configured, the product page loads the
  Filecheck upload element from this domain for any option set that has an
  artwork-check step.
* *What is sent* — the artwork file the customer chooses, and the check
  settings for that option set (such as the required size, bleed and page
  count). The check result — page count, artwork dimensions and any
  warnings — comes back to the page and is stored with the order line so
  you can see what was checked. No customer names, emails or addresses are
  transmitted.

This service is operated by Filecheck (Print.App ApS): https://filecheck.io/
Privacy policy: https://filecheck.io/company/privacy
Terms of service: https://filecheck.io/company/terms

== Source Code ==

Two files in assets/ are compiled from TypeScript and Vue sources:

* assets/print-configurator.js — the storefront configurator
* assets/builder.js and assets/builder.css — the option-set builder used on
  the plugin's own admin page

The full, human-readable source and the build tooling are available at:

https://github.com/PrintApp/print-options-wordpress

Run `npm install`, then `npm run build` in the core-ui package for the
configurator and in the admin package for the builder; the outputs are the
files bundled here unchanged.

== Frequently Asked Questions ==

= Where do I build the options? =
Print Options → Option Sets, inside your own admin. Start from a template and
adjust the choices and prices to match what you sell.

= Can several products share the same options? =
Yes — assign the same set on each product's Print Options tab. Saving the set
once updates all of them.

= Do I need an account or API keys? =
No. The plugin creates its own anonymous identity when you activate it, and
talks to the service on your server's behalf.

= What happens if the verification endpoint is down? =
Adding to cart is refused with a friendly error. The plugin never falls back
to a browser-computed price.

= Is it really free? =
Yes, with no product or option limits.

= Can the configurator be translated? =
Yes. Danish, German, French, Spanish, Italian, Dutch and Romanian ship with
the plugin and follow the site language automatically. Every label the
configurator renders itself ("Summary", "Add to cart", "Drop your file
here…", validation messages) goes through WordPress translation, so for any
other language a language pack from translate.wordpress.org, Loco Translate
or a .po file in wp-content/languages/plugins applies. Option names, choices
and help text come from your option set and are written in whatever language
you type them in. To change individual labels from code, use the
`papo_widget_strings` filter. Prices follow your WooCommerce currency
settings (symbol, position, decimal and thousand separators).

= Can I show a tax note next to the price? =
The configurator shows the WooCommerce price display suffix (WooCommerce →
Settings → Tax → Price display suffix) under the total. To use different
wording, or to hide it, return your text from the `papo_price_note` filter.

= Does the summary show the tax? =
Yes, automatically, when WooCommerce taxes are on and prices are displayed
including tax (WooCommerce → Settings → Tax → "Display prices in the shop").
If you enter prices without tax, the summary lists the total excluding tax,
the tax, and the total including tax. If you enter prices with tax, it shows
the tax included under the total. The rate is the one that applies to the
shopper's location. Shops that display prices without tax see no breakdown.
It is for display only: the cart and checkout calculate tax as before. To
change or hide it, use the `papo_tax_display` filter (return an empty array
for none).

= Can the cart show the real quantity instead of 1? =
Yes. Open the option set, and on the Product panel set "Line quantity" to
"Real quantity". The cart and order line then show the configured quantity at
a per-copy price, and stock and shipping weight follow it. This is applied
only when the total divides exactly by the quantity (a 10.00 job of 3 copies
cannot be 3.33 each), so some jobs will still appear as one line of quantity
1 at the same total. The quantity of a real-quantity line cannot be edited in
the cart; the customer changes it on the product page so the price is
verified again. If you track stock on the product, make sure it covers your
largest jobs before turning this on.

= How is shipping weight calculated? =
Enter the weight of ONE copy on the WooCommerce product. A configured job is a
single cart line, and the plugin gives that line the product weight multiplied
by the configured quantity, so weight-based shipping rates are right. Use the
`papo_cart_item_weight` filter if the weight depends on the chosen options.

= Why does the product's own price not match the option set? =
It is not used. A product with an option set is priced entirely by the set's
base price and modifiers, re-verified on the server at add-to-cart, and the
product's regular price is hidden on the storefront. Leave the regular price
at 0 (or any placeholder) and treat the option set as the single source of
truth.

== Screenshots ==

1. The configurator on a product page: options, live pricing, and the verified total.
2. The visual builder — outline, editor and a live preview of the storefront widget.
3. Ready-made print templates: business cards, flyers, stickers, thesis binding and more.
4. Every price is recomputed and signed on the server before it can reach the cart.

== Changelog ==

= 0.4.15 =
* Fix: on a narrow product page column, on phones and in the option set
  preview, the summary no longer stays stuck to the bottom of the screen
  over the options. It now follows the options and scrolls with the page.

= 0.4.14 =
* New: the summary can show the tax. With WooCommerce taxes on and prices
  displayed including tax, it lists the total excluding tax, the tax and the
  total including tax (or, for prices entered with tax, the tax included),
  at the rate for the shopper's location. Display only; checkout calculates
  tax as before. See the FAQ.
* Improved: large price matrices. Option sets are stored in a compact form
  (about 30 times smaller), and an option set can now be up to 1 MB, so a
  price list across six or seven options with a few thousand combinations
  fits.

= 0.4.13 =
* Improved: the price matrix lists the fields that cannot be one of its
  options (only single-choice fields can), and turns a multiple-choice field
  into a single choice in one click.
* Fix: deleting a field used by the price matrix, or changing its type, no
  longer leaves the option set invalid; deleting a choice also removes the
  matrix prices set for it.

= 0.4.12 =
* New: the price matrix (Product panel, "Price matrix") now takes any number
  of options, so a supplier price list (quantity x paper x sides x turnaround
  x finishing, say) can price every combination exactly. One or two options
  show as a grid; any number as a filterable list with price, availability
  and SKU per combination.
* New: import and export the matrix as CSV. The export lists every
  combination, ready to fill in a spreadsheet; the import reads comma,
  semicolon or tab files, decimal commas, and matches options and choices by
  name, reporting any row it could not use.

= 0.4.11 =
* New: a "Download file" button under each order line with an uploaded file,
  on the order screen in the admin. It works for existing orders too, as long
  as the file is still stored (uploads are kept for 30 days).
* Downloads keep the customer's original file name.

= 0.4.10 =
* Fix: a product priced entirely by its options (for example a price per
  size, with the base price left at 0) no longer shows a "Base price 0,00"
  line in the summary. A base price with an amount is still listed.

= 0.4.9 =
* Fix: the quantity shown on the product page, the cart line and the order
  is always the quantity that is charged. On an option sold in steps (25,
  50, 75…), a typed or script-set number such as 333 was priced as 325 but
  still listed as 333; it now snaps to 325 when the customer leaves the
  field, and every line says 325.

= 0.4.8 =
* New: real quantities, an opt-in setting on each option set (Product panel,
  "Line quantity"). The cart and order line carry the real copy count at a
  per-copy price, so WooCommerce's quantity, stock and shipping weight all
  use the true number. Applied only when the verified total splits exactly
  across the copies; any other job stays one line at the same total. The
  quantity of such a line is fixed in the cart, because the price was
  verified for that count: customers change it on the product page.

= 0.4.7 =
* New: a quantity option can carry a unit word ("banners", "cards"), shown
  after the number on the cart line and the order: "5 banners"
* Fix: a quantity option without a label is listed as "Quantity" on the cart
  line and order instead of its internal id

= 0.4.6 =
* Fix: shipping weight. A configured job is one cart line, so weight-based
  shipping saw the weight of a single copy. The line now weighs the product's
  weight multiplied by the configured quantity. The `papo_cart_item_weight`
  filter adjusts it, and the order line records the total as `_papo_weight`.
* Builder: quantity breaks on the base price can now be seen and edited on the
  Product panel. Templates such as Business Cards price their base this way,
  and the plain Amount field had no effect while the breaks were hidden.

= 0.4.5 =
* New: the configurator ships translated into Danish, German, French,
  Spanish, Italian, Dutch and Romanian — the site language is picked up
  automatically. Community translations on translate.wordpress.org take
  precedence once available.
* Fix: a design made in a connected designer (for example Print.App) is now
  labelled in the site language instead of "Your design"
* Change: the design summary shows the page count only on products that are
  priced by page; per-unit products no longer show "1 page"

= 0.4.4 =
* New: quantity fields can take turns. Add one quantity field per group of
  choices, each with a visibility rule (for example a paper that only comes
  in three of your set quantities), and the visible one is the quantity that
  is priced. Only one quantity field may be unconditional.
* Builder: a quantity field can no longer be shown or hidden by the quantity
  itself (circular)

= 0.4.3 =
* Fix: prices in the configurator ignored the site language — WordPress
  locales such as ro_RO were rejected by the browser's number formatter and
  the summary fell back to "RON 10.00"
* New: the summary uses your WooCommerce currency format (symbol, position,
  separators), so it prints "10,00 lei" exactly as the cart will
* New: every configurator label is translatable through WordPress i18n, with
  a `papo_widget_strings` filter for per-site wording
* New: the WooCommerce price display suffix (for example "incl. VAT") shows
  under the total; `papo_price_note` sets custom wording
* Theming: `::part()` hooks for the unit-price line (summary-unit), the
  price note (summary-note), summary line labels/values and the choices
  recap rows

= 0.4.2 =
* New: file upload fields can be set to "Designer only (no direct upload)" -
  only connected design tools (for example the Print.App designer) are
  offered, without a dropzone
* Fix: the configurator sized its text from the page root, so themes that
  set the root font size to 62.5% rendered it at roughly 60% of the theme's
  text size - it now follows the surrounding text
* Fix: the widget's numeric inputs no longer shrink on those themes
* Builder: per-length price rules (roll and linear pricing) with length-based
  volume breaks

= 0.4.1 =
* Fix: option sets with quantity tiers on individual choices (for example
  size-dependent price breaks) could not be saved — the values were being
  truncated before they reached the server and the save was refused

= 0.4.0 =
* The visual builder now ships with the plugin and runs on its own admin page
  instead of being embedded from options.print.app
* All classes, constants, options, transients, post meta and hooks carry a
  PAPO_/papo_ prefix; existing store identity and product assignments are
  migrated automatically on update
* Configuration submitted with add-to-cart is sanitized value by value
* Filecheck artwork preflight documented under External Services

= 0.3.0 =
* Print Options tab on the product edit page — assign a named option set from
  a dropdown, no JSON pasting
* Embedded visual builder (Print Options → Option Sets) to create and manage
  option sets
* Option sets are served from the CDN and shared across products; editing a
  set updates every product that uses it
* Anonymous store identity; all management calls are HMAC-signed server-side

= 0.2.0 =
* Full add-to-cart bridge with server-side price verification
* Settings page, per-product options metabox, order line persistence

= 0.1.0 =
* Initial stub
