The plugin can also send paid orders to a fulfilment provider for you, with no code. To fetch files by hand instead, they are listed against each order in your WordPress admin: see How to access files.
1. Find the project on the order
The plugin stores the design on each order line as the item metaprint_app_customization, an array that holds the projectId:
2. Download the print-ready PDF
The PDF is at:pdf for png, jpeg or tiff in the host name.
- It renders on request. The file is produced from the saved project when you ask for it, which takes a few seconds. Allow a generous timeout.
- It answers with a redirect to a short-lived download link. Follow the redirect.
wp_remote_getdoes so by default. - Download it once, when the order is paid, and keep your own copy. A later download reflects the project’s state at that later time.
- The link works without a key. Treat it as confidential, and don’t publish it.
3. Send the order to your print partner
This runs when an order becomes processing, which for most payment methods means it has been paid. It collects each cover PDF, stores a copy and creates one print job per order. Add it to a small plugin or your theme’sfunctions.php:
my_create_print_job is your own call to your partner’s API. A few things to decide for production:
- Retries. If a download or the partner’s API fails, the hook stops without marking the order. Re-run it for that order later, for example with a scheduled action.
- Storage. Media uploads are public URLs. The random file name keeps them unguessable, but you can also store the files privately and delete them once your partner has fetched them.
- Idempotency. The
_print_job_idcheck stops the same order being sent twice when its status changes again.
Fulfilment providers
The plugin can send paid orders to a fulfilment provider itself, so the code above isn’t needed for that provider. Providers are optional and off until you set one up. In your WordPress admin, open PrintApp in the left menu and expand Fulfilment providers at the bottom of the page. The providers available now:- Lulu, for print-on-demand books, notebooks and journals
Lulu
Sends orders to the Lulu Print API (plugin 2.4.0 and later). It’s built for personalised notebooks and books: the customer designs the cover in Print.App, and the interior PDF is the same for every order.1
Get Lulu API keys
Generate an API key and secret at developers.lulu.com. To test first without printing or paying for anything, use Lulu’s sandbox, which has its own keys.
2
Connect Lulu
In your WordPress admin, open PrintApp, expand Fulfilment providers, then Lulu. Enter the API key and secret, choose the environment (Sandbox or Production) and pick a shipping level, then save. Lulu writes to the contact email if it has questions about a print job; it defaults to the site admin email.Once the key and secret are saved, products get a Lulu tab. Nothing is sent until you switch on Send paid orders to Lulu, so you can set up your products first.
3
Set up the product
On the WooCommerce product, open the Lulu tab under Product data and fill in:
- Lulu product (POD package ID), the book specification from Lulu’s pricing calculator, such as
0600X0900.BW.STD.CO.060UW444.MXX - Interior PDF URL, a link Lulu can download your fixed interior PDF from
- Interior page count
311.2 × 235 mm. If Lulu can’t work it out, for example because of a mistyped product ID, the tab shows Lulu’s reason instead.For a variable product whose variations are different Lulu products, such as a glossy and a matte cover, open Variations and set each variation’s own Lulu product. A variation left empty uses the product’s. All variations share the product’s interior PDF and page count.4
Design the cover at that size
Lulu prints the cover from one PDF page that holds the back cover, spine and front cover. Make the Print.App design a single page at exactly the size the Lulu tab shows. That size already includes bleed, so don’t add any on top.Lock the back cover and spine with the object lock settings, so customers personalise only the front. Assign a PDF output profile that matches Lulu’s file requirements.
5
Test in the sandbox
Switch on Send paid orders to Lulu with the Sandbox environment. Place an order for the product and mark it Processing. Within a few minutes the order notes show the Lulu print job. Use the order action Refresh Lulu print job status to see whether Lulu accepted the files. Switch to Production once it does.
What happens to an order
- When an order becomes Processing, the plugin sends it to Lulu in the background as one print job. Each order line with a Print.App design, on a product with a Lulu product and interior PDF set, becomes a line item with its quantity. Other lines are left out, so mixed orders are fine.
- The cover is downloaded from
pdf.print.appand stored in your uploads folder under an unguessable name, for Lulu to fetch. - The address is the order’s shipping address, or the billing address when there is none. Lulu allows at most 30 characters in each street and city line, and 35 in the name.
- Temporary failures are retried after 15 minutes and again after an hour. These include a network error, a cover PDF that couldn’t be generated, or Lulu being busy.
- An order is never sent twice, even if its status changes again.
- Every result is written to the order notes: the print job number, its status, and Lulu’s reasons if it refuses an address or rejects a file.
- The status is checked automatically every few hours until the job ships, is rejected or is canceled (plugin 2.4.2 and later). A note is added only when something changes, with tracking links once it ships.
- Optionally, shipped orders are completed. With Complete shipped orders on, an order Lulu has shipped is marked Completed, and WooCommerce’s “order complete” email to the customer includes the tracking link. This applies only to orders where every item went to Lulu.
Shipping
Lulu ships each order with one of its shipping levels, from Standard mail (the cheapest and slowest) to Express. You can choose the level in either of two ways.- One level for every order. Set Lulu shipping level under PrintApp → Fulfilment providers → Lulu; it’s MAIL by default. Set your WooCommerce shipping rates, for example a flat rate, to cover what Lulu charges for that level.
- Let customers choose, at Lulu’s prices (plugin 2.4.4 and later). Under WooCommerce → Settings → Shipping, add the Lulu shipping method to a shipping zone. At checkout, customers see Lulu’s options for their address with Lulu’s prices and estimated delivery dates, and the option they pick is the level Lulu ships the order with. In the method’s settings, choose which levels to offer and add a markup if you like.
printapp-lulu).
The order’s shipping address is always sent to Lulu with the print job.
Paying for print jobs
Lulu bills your Lulu account, not your customer. A new print job stays Unpaid until you pay for it in your Lulu account, unless you keep a payment card on file with Lulu. An order note such as “print job #354632 is UNPAID. Lulu accepted the files” means the files passed Lulu’s checks and the job is waiting for payment.If Lulu rejects a file
The order note gives Lulu’s reason. The common ones are about the cover:- The PDF dimensions need to be within a range. The design isn’t the cover size shown in the product’s Lulu tab.
- The cover must be a single page. The design has more than one page.