=== Pressria for WooCommerce ===
Contributors: pressriacom
Tags: woocommerce, print on demand, web to print, custom products, custom goods
Requires at least: 6.5
Tested up to: 7.0
Stable tag: 1.0.3
Requires PHP: 7.4
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Pressria web-to-print integration for WooCommerce products.

== Description ==

This plugin connects your WooCommerce store to Pressria, enabling web-to-print
product customization for your customers.

Customers open a design editor from the product page, personalize the product,
and their finished design is shown in the cart, at checkout, and on the order.
When an order is paid, the design references are sent to Pressria so the item
can be produced.

Use of this plugin requires a Pressria account, which is created from the
plugin settings screen.

Pressria charges a usage-based fee for completed designs. A monthly free
allowance of completed designs (production PDFs) is included; beyond it, each
additional completed design is charged as a percentage of the customized line
item's sale amount, with a small per-item minimum (defined per currency). If an
order is cancelled or refunded, the percentage sales fee is waived and only the
per-item minimum applies, since the production file has already been generated.
Usage and estimated charges are aggregated per calendar month (UTC) and can be
reviewed at any time in the Pressria admin under Usage & Billing.

== External Services ==

This plugin relies on Pressria (https://pressria.com) to provide web-to-print
functionality. It cannot work without this service. Data is transmitted in the
following situations:

1. On plugin activation — to register this installation.
   Sent to https://pod.pressria.com: site URL, a randomly generated install token.

2. When you connect your shop (from the plugin settings screen).
   Sent to https://pod.pressria.com: shop name, shop administrator email address,
   shop logo URL, language, site URL, install token.

3. When a product is created, updated, deleted, or synced.
   Sent to https://pod.pressria.com: product ID, product name, product status,
   product type, product thumbnail URL, product categories, product permalink,
   site URL. For a variable product, the names of the options used for its
   variations and their available values are also sent (for example
   "Colour: White, Black"), so that the correct design template can be matched
   to the option the customer selects. No prices, stock levels or customer data
   are sent.

4. When a product page is viewed — to check whether the product is customizable.
   Sent to https://pod.pressria.com: product ID, site URL.

5. When a customer opens the design editor on a product page.
   The editor is loaded from https://pod.pressria.com in a frame, and receives
   the site URL, a timestamp, a signature, and the product ID. Any content the
   customer adds to their design (for example uploaded images or text) is sent
   to and stored by Pressria in order to produce the item.

   If your Pressria account is configured with a custom editor domain, Pressria
   returns that domain when the plugin checks the product (item 4 above) and the
   editor is loaded from it instead. That domain is one you or Pressria set up
   for your own shop; no third party is involved, and the data sent is the same
   as described above.

6. When an order reaches a paid status (processing or completed).
   Sent to https://pod.pressria.com: order ID, order number, order status,
   currency, order total, payment date, site URL, and for each line item the
   item ID, product ID, variation ID, product name, quantity, line total, and
   the design references (design code and design image key).

   Line item amounts are the sale amounts actually paid in your shop (after
   discounts, excluding tax). They are transmitted for two purposes: to display
   your orders in the Pressria order console, and to calculate Pressria's
   usage-based fee, which is billed as a percentage of the customized line
   item's sale amount beyond the monthly free allowance. Your usage and
   estimated charges are shown in the Pressria admin under Usage & Billing.

   Customer personal data (name, email address, phone number and shipping
   address) is NOT transmitted.

7. When a previously transmitted order is cancelled or refunded.
   Sent to https://pod.pressria.com: order ID, order number, new order status,
   site URL. This adjusts the usage-based fee for that order: the percentage
   sales fee is waived and only the per-item minimum applies. The same is sent
   when such an order is later restored to an active status, which reinstates
   the fee.

   When individual line items are refunded (a partial refund), the order status
   does not change, so the design codes of the fully refunded line items are
   sent instead: order ID, order number, the design codes currently in a
   refunded state, and site URL. The fee is waived per design code rather than
   for the whole order.
   Refunding part of a line item's quantity, or refunding an amount without
   reducing the quantity, does not waive the fee — the design was still
   produced.

8. Finished design images are served from https://cdn.pressria.com. Your
   visitors' browsers request these images directly when a design thumbnail is
   displayed in the cart, at checkout, on order pages, in order emails, and in
   the WordPress admin order screen.

Terms of Service: https://goods.pressria.com/terms/
Privacy Policy: https://goods.pressria.com/privacy/

== Installation ==

1. Install and activate the plugin. WooCommerce must be active first.
2. Open Pressria in the WordPress admin menu.
3. Create or connect your Pressria account from the settings screen. Your shop
   is registered with Pressria and the free plan is applied.
4. Open the Product Manager, enable the products you want to make customizable,
   and define the print area for each one.
5. Optionally use Sync All Products to send your existing WooCommerce products
   to Pressria in one pass.

An Edit Design button then appears on the product page of every enabled
product. Your shop caches whether a product is editable, so a newly enabled
product can take a few minutes to show the button - Refresh Product Status on
the settings screen applies the change immediately.

Full documentation is available in the Pressria admin under User Manual, or at
https://pod.pressria.com/shop/document/shopStore/en/

== Frequently Asked Questions ==

= Is a Pressria account required? =

Yes. The plugin creates an account for you from the plugin settings screen and
cannot provide web-to-print functionality without connecting to Pressria.

= Does the plugin send customer personal information? =

No. Order data sent to Pressria contains the order identifiers, amounts and the
design references needed for production, but not the customer's name, email
address, phone number or shipping address.

= Why does the plugin send order amounts to Pressria? =

Pressria's fee is usage-based: beyond a monthly free allowance of completed
designs, each additional completed design is charged as a percentage of the
customized line item's sale amount (what the customer actually paid, after
discounts and excluding tax), with a small per-item minimum. Sending the line
amounts is what makes this "pay only when you sell" model possible — there is
no charge on your catalog, stock, or unsold designs. Current usage and the
estimated monthly charge are always visible in the Pressria admin under
Usage & Billing.

= What happens if the connection fails when an order is paid? =

The plugin retries in the background up to five times using Action Scheduler,
which is bundled with WooCommerce. Failures are recorded as order notes.

== Screenshots ==

1. Your WooCommerce product page gets an Edit Design button next to Add to Cart.
2. Apparel - the customer places a design and previews it on a product
   mockup, front and back.
3. Phone case - the same editor adapts to each product, with that product's
   own mockup.
4. Footwear - print guides keep the artwork inside the printable area of the
   product.
5. Keyring - production options such as size, cutting margin, ring position
   and hole size, with a 3D preview.
6. Sticker sheet - die-cut layout with crop marks and a safe area.
7. The finished design travels with the line item into the cart, and can be
   reopened from there.
8. Plugin settings in the WordPress admin - connection status, product sync
   and the product manager.
9. Usage & Billing - free allowance, per-code charges and the estimated
   amount on your next invoice.

== Changelog ==

= 1.0.3 =
* Scheduled background jobs are now cancelled when the plugin is deactivated.
  Previously they stayed in the WordPress cron table after deactivation.
* Deleting the plugin now removes the settings, cached product states and
  product metadata it created. Order records are deliberately left untouched,
  so past orders keep showing which design they were produced from.
* Requires WordPress 6.5 or later, which is the version that enforces the
  WooCommerce dependency declared by this plugin.

= 1.0.2 =
* Order cancellations and refunds are now reported to Pressria so that the
  usage-based fee is adjusted. Previously only paid orders were sent, and a
  refunded order kept being charged the full percentage fee.
* Partial refunds are supported. Refunding a line item's full quantity waives
  the percentage fee for that design; refunding part of the quantity, or an
  amount without reducing the quantity, does not, because the design was still
  produced.
* Deleting a refund in WooCommerce restores the fee for the affected designs.
* Cancellation and refund reports that fail to reach Pressria now retry in the
  background (Action Scheduler, up to five attempts) and are recorded as order
  notes. Previously a single failure was silent.
* The order number is now sent with cancellation and refund reports, so shops
  using a custom order-numbering plugin are matched correctly.

= 1.0.1 =
* Product sync now includes the option names and values used by a variable
  product's variations, so a design template can be matched to the option the
  customer selects.
* On a variable product, the design editor now opens with the variation the
  customer selected on the product page, instead of always using the first one.
* The Edit Design button stays disabled until a variation is selected, with a
  short hint explaining why.
* The Edit Design button now follows the active theme's button styles, so it no
  longer appears unstyled or full width on block themes.
* Tested up to WordPress 7.0 and WooCommerce 10.9.

= 1.0.0 =
* Initial release.
