=== Printcart Photobook ===
Contributors: printcart
Tags: photobook, woocommerce, print-on-demand, product designer, personalization
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell WooCommerce photobooks with an embedded designer, one-step Printcart connect, per-copy CMYK pricing, plus native products, pricing and orders.

== Description ==

Printcart Photobook turns WooCommerce products into multi-page photo-album designers. Shoppers design the cover, spine, inside covers and any number of interior spreads in an embedded designer; the plugin bridges the finished design into the WooCommerce cart, prices every copy on the server, and — through the Printcart Cloud — renders a print-ready CMYK book for fulfilment.

It is a productized, standalone plugin with its own top-level admin menu. You connect a Printcart account in one step, and the rest of the workflow — pricing, products, orders, design files and canvas behaviour — is managed natively inside WordPress. A free Printcart account is required (it powers the designer, pricing and print render), and photobooks are sold as WooCommerce products, so WooCommerce is required too.

**Who it is for**

Print shops, photographers, agencies and WooCommerce merchants who want to sell personalized photobooks without building a designer or a print pipeline themselves.

**Key features**

* One-step Printcart connect with a guided setup wizard — sign in or create a free account right inside wp-admin; the plugin binds this site to the right store automatically.
* Embedded photobook designer on product pages — a full-screen canvas where shoppers lay out every page, with the finished design bridged into the WooCommerce cart and order.
* Native Pricing management — create and manage per-copy pricing options in WordPress, with a live per-copy estimate as you build them.
* Native Products — create a photobook product with a guided wizard, or enable an existing WooCommerce product as a photobook.
* Orders — a photobook orders list plus a detailed per-order view that shows every page of the book, with one-click sample data so you can explore the flow immediately.
* Design Files library — browse the design files your shoppers produce.
* Canvas Workflow settings — control how the designer behaves (placement, autofill, print quality, layout, content tabs, cover & spine, save & proof), kept in sync with your Printcart Dashboard.
* Server-authoritative, per-copy CMYK pricing — the storefront never sends a trusted price; Printcart recalculates from your catalog and renders the print-ready book.
* WooCommerce HPOS (custom order tables) compatible.

== Installation ==

1. Upload the `printcart-photobook` folder to `/wp-content/plugins/`, or install it from the **Plugins** screen in WordPress.
2. Make sure WooCommerce is installed and active.
3. Activate **Printcart Photobook** through the **Plugins** menu.
4. Open **Printcart Photobook** in the admin sidebar and follow the one-step connect: sign in to Printcart, or create a free account, right on the screen. The plugin connects this site to your store automatically.
5. Use the setup wizard to create your first pricing option and a photobook product. On a connected store you can also load one-click sample data to preview the whole flow.

== Frequently Asked Questions ==

= Do I need a Printcart account? =

Yes — and it is free. The photobook designer, per-copy pricing and print render are all provided by the Printcart Cloud. You can sign in to an existing account or create a free one directly from the plugin's connect screen; see the "External services" section below for exactly what is sent and when.

= Does it need WooCommerce? =

Yes. Photobooks are sold as WooCommerce products, so WooCommerce must be installed and active. Without it the admin screens still load, but no products or orders are shown.

= Do shoppers have to enter my Printcart password? =

No. Your Printcart sign-in email and password are used once, by you, on the connect screen to authenticate; they are never stored in WordPress. Shoppers only ever see the designer.

= Where is the canvas workflow configuration stored? =

Your Printcart Dashboard is the source of truth. The plugin's Canvas Workflow page is a synced editor that reads and writes the same backend configuration, so changes stay consistent across WordPress and the Dashboard.

= Why does my photobook cover not show on the Cart page straight away? =

On the block-based Cart and Checkout pages, the first time you view a newly designed photobook the line still shows the product image. The plugin never contacts Printcart while a page is rendering, so your cover is fetched in the background once the page has loaded and appears on the next render -- usually the moment you continue to checkout, change a quantity, or reload. It is then cached for 15 minutes. The classic Cart and Checkout shortcodes swap the cover in without that extra step.

= How is pricing calculated? =

Pricing is always server-authoritative and per-copy. The storefront only sends the shopper's selections; Printcart recalculates the price from your pricing options. A client-supplied price is never trusted.

== External services ==

This plugin connects to the Printcart Cloud (a third-party service operated by Printcart) to power the photobook designer, pricing, product/order sync and print rendering. It cannot function without it. Below is exactly what data is sent, when, and to which service. Nothing is sent until you connect a Printcart account.

**1. Printcart Cloud API — https://api.printcart.com**

*Account connection.* When you connect on the setup screen, your Printcart sign-in email and password are sent once to https://api.printcart.com/v1/account/signIn to authenticate. They are never stored in WordPress; every later request uses the store credentials returned by that call.

*Store management.* When you manage pricing options, products, design files or the canvas workflow in wp-admin, the plugin sends the corresponding pricing/product/project data to https://api.printcart.com/v1 (endpoints under /printing-options, /products, /projects, /stores and /customizer) so it can be created, read and updated in your Printcart catalog.

*Designer and pricing.* When a shopper opens the designer or the store prices a photobook, the shopper's selections and the relevant product/pricing identifiers are sent so Printcart can render the canvas and recalculate the per-copy price. A client-supplied price is never trusted.

*Order sync — includes buyer personal data.* When a WooCommerce order containing a photobook is placed (as the order is created at checkout, on the `woocommerce_checkout_order_processed` hook for the classic checkout and on `woocommerce_store_api_checkout_order_processed` for the block checkout), the plugin POSTs that order to `https://api.printcart.com/v1/integration/woocommerce/orders` so Printcart can produce and fulfil the book. Orders with no photobook line item are not sent. The payload contains exactly:

* Order data: WooCommerce order id, order number, order key, order status, currency, total, subtotal, shipping total, tax total, payment method and payment method title, and the WordPress customer id.
* Line items (photobook items only): line item id, product id, variation id, product name, quantity, the design ids and the Printcart project id.
* **Buyer personal data: billing first name, billing last name, billing email address and billing phone number, plus shipping first name and shipping last name.**
* Not sent: billing or shipping street address, city, postcode or country; payment-card or other payment-instrument data; customer account passwords; and any customer note.
* **Why:** to authenticate your store, render the photobook designer, calculate per-copy pricing, manage your products and pricing, and produce and fulfil the print-ready CMYK book. The buyer name, email address and phone number are transmitted so Printcart can identify the order for fulfilment and reach the recipient about it.
* Terms of Service: https://solution.printcart.com/tos/licenses-and-terms
* Privacy Policy: https://printcart.com/privacy-policy

**2. Printcart activation events — https://api.printcart.com/v1/integration/woocommerce/commerce-events**

* **What is sent:** store-scoped lifecycle signals only — for example "store connected", product/pricing setup state, and "order created" (order status/number and the photobook project ids). Each signal also carries technical identifiers that describe the sending store and plugin, not a person: your Printcart store id, your site URL, the event name, severity and timestamp, the affected resource type and id, the plugin's own key, version and distribution channel, and the list of plugin capabilities that are enabled. **No customer or buyer personal data is sent.**
* **When:** when you connect the store, when the plugin detects a setup step is still needed (no product / no published pricing), and when a photobook order is placed.
* **Why:** so Printcart can send you, the merchant, the right setup and activation emails. This emitter is best-effort and never blocks or delays checkout.
* Terms of Service: https://solution.printcart.com/tos/licenses-and-terms
* Privacy Policy: https://printcart.com/privacy-policy

**3. Printcart design editor app — https://customizer.printcart.com**

* **What is sent:** when a shopper opens a photobook product, the browser loads the Printcart design editor in an iframe using your store's read-only token and the Printcart product id. The shopper's design selections and placed/uploaded images are sent to Printcart so the design can be saved, priced and later rendered to a print-ready PDF.
* **When:** on the storefront, each time a shopper opens the designer for a photobook product.
* **Why:** to let shoppers design their photobook in the browser.
* Terms of Service: https://solution.printcart.com/tos/licenses-and-terms
* Privacy Policy: https://printcart.com/privacy-policy

== Screenshots ==

1. One-step Printcart connect + setup wizard.
2. Merchant dashboard overview.
3. Pricing options list.
4. Create pricing with a live per-copy estimate.
5. Create a photobook product (guided wizard).
6. Order detail — every page of the book.
7. Design files library.
8. Canvas workflow settings.
9. Product page — the photobook panel and starting per-copy price.
10. Cart — page and spread count, chosen options, per-copy price, Edit design.
11. Order received — photobook summary under the line item.
12. My account, view order — the same photobook summary.
13. Product page at phone width.

== Changelog ==

= 1.2.0 =
* Added: choose the gap printed between photos in a multi-photo layout (Canvas Workflow → Layout & structure). It is millimetres of print, so the same physical gap on a small book and a large canvas, and it defaults to 0 so photos touch.
* Fixed: a workflow setting your Printcart account does not yet support no longer breaks every Save on the Canvas Workflow screen. Unsupported settings are shown disabled and say so, instead of a Save that never works.
* Fixed: a per-product workflow override is no longer lost when Printcart stops supporting the setting — it is kept on the site and written back once support returns.
* Fixed: a photobook priced from a "Page count" list is charged for the right book. One that cannot be matched to an option in your own list is refused with an explanation rather than priced on a guess.
* Fixed: a photobook priced per extra spread is charged for its spreads even when the browser does not send a page count.
* Fixed: a partly refunded order is now visible as refunded. WooCommerce only marks an order refunded on a full refund, and the refund call a gateway actually makes marks nothing at all.
* Fixed: "Order again" can no longer put an undesigned photobook in the cart.
* Added: filters `pcpb_selection_pages_option_from_sides`, `pcpb_require_reserved_design` and `pcpb_undesigned_add_to_cart_notice`.

= 1.1.0 =
* Changed: activating the plugin no longer redirects you anywhere. Setup is reached from the "Get started" link on the plugin's own row, and every screen is browsable before you connect an account.
* Fixed: an order you refund or cancel is never sent to Printcart, including by the background retry that runs minutes after checkout.
* Fixed: an order Printcart refuses outright is no longer retried on the schedule meant for outages — you get the real answer and the manual retry straight away, and the order note says it was refused rather than claiming three attempts.
* Fixed: editing a photobook already in the cart replaces that line instead of adding a second one, so the shopper is no longer charged twice.
* Fixed: a book whose price Printcart could not confirm can no longer be checked out at the plain product price.
* Fixed: the "from" price on the product page now reflects the cheapest configuration the designer can actually produce.
* Added: if the designer fails to load, the overlay now offers "Try again" and "Close" instead of spinning indefinitely.
* Added: orders that could not be delivered to Printcart are flagged as such, record the failure, and can be retried by hand.
* Added: book size and pricing template can be changed after a photobook product has been created.
* Changed: the starter photobook is now a fully functional product — the clipart library and photo uploads work in it, and it can be sold, unpublished, or duplicated like any other product.
* Changed: admin screens no longer block on Printcart while rendering, so a slow connection cannot stall wp-admin.
* Security: API credentials are no longer written into the connection form's HTML, and the manual credential fields now require the `manage_options` capability.

= 1.0.1 =
* Improved reliability when sending a photobook order to Printcart: an order is marked synced only after Printcart confirms delivery, with bounded retries for temporary failures.
* API credentials now use a dedicated non-autoloaded WordPress option and are removed when the plugin is uninstalled.

= 1.0.0 =
* Initial release.
* Embedded photobook designer on WooCommerce product pages, bridged into the cart and order.
* One-step Printcart connect with a guided setup wizard (sign in or create a free account in wp-admin).
* Native Pricing management with a live per-copy estimate.
* Native Products — create a photobook product with a guided wizard, or enable an existing WooCommerce product.
* Orders — list, per-order detail showing every page of the book, and one-click sample data.
* Design Files library for browsing shopper design files.
* Canvas Workflow settings synced with the Printcart Dashboard.
* Server-authoritative, per-copy CMYK pricing.
* Printcart activation events so merchants receive setup/activation emails.
* WooCommerce HPOS (custom order tables) compatibility.
* Full disclosure of the data sent to Printcart — see "External services" above, the "Data sent to Printcart" panel on the plugin's Help & About screen, and the suggested text the plugin adds under Tools > Privacy.
* Uninstall removes every option and user preference the plugin creates, on single sites and multisite alike.

== Upgrade Notice ==

= 1.2.0 =
Fixes two ways a photobook could be charged for the wrong book, makes a partly refunded order visible, and stops an unsupported workflow setting breaking every Save on the Canvas Workflow screen.

= 1.1.0 =
Fixes two charging bugs: editing a cart photobook no longer duplicates the line, and a book with an unconfirmed price can no longer be bought at the plain product price. Also makes the starter photobook a fully functional product and stops credentials being rendered into admin HTML.

= 1.0.1 =
Improves checkout order-sync reliability and hardens API credential storage.

= 1.0.0 =
Initial release.
