LH Woocommerce PDF Invoicing dynamically generates a PDF invoice for every WooCommerce order, served via a REST API endpoint. Nothing is written to disk or cached — the PDF is generated fresh on every request, using DOMPDF (vendored via Composer). The invoice number is simply the WooCommerce order number, so no separate invoice sequence or database table is needed.
Key features
- REST endpoint (
GET /wp-json/lh-woocommerce-pdf-invoicing/v1/invoice/{order_id}) that streams a binary PDF, with permission checks so admins can fetch any order and customers only their own. - “Download PDF Invoice” button in the order edit screen metabox and the WooCommerce order actions dropdown.
- “Download Invoice” button on the customer’s My Account → Orders screen.
- PAID (green) / AMOUNT DUE (amber) banner on the invoice, driven by
$order->is_paid()so it works acrossprocessing,completed, and custom paid statuses. - Site logo, company/registration number, VAT/ABN number, BACS bank details (auto-populated from WooCommerce settings on unpaid orders), and a disclaimer block — all optional and filter-driven.
- No database tables and no cron jobs — everything is derived from the order at render time.
Requirements
- WordPress 6.0+
- PHP 8.0+
- WooCommerce (any recent version)
- Composer, for the initial vendor install
Install
- Upload the
lh-woocommerce-pdf-invoicingfolder towp-content/plugins/. - In the plugin directory, run
composer install --no-dev --optimize-autoloaderto install DOMPDF and its dependencies intovendor/. - Activate the plugin.
Bundled libraries
DOMPDF v2.x (LGPL-2.1), plus DOMPDF’s own dependencies vendored alongside it — phenx/php-font-lib, phenx/php-svg-lib, masterminds/html5, and sabberworm/php-css-parser. Since these are vendored copies rather than a shared Composer install, PHP-version deprecation fixes to them sometimes need to be patched directly in this plugin rather than waiting on a WooCommerce/DOMPDF update — see the Changelog.
Contents
- REST API & Admin Interface — endpoint, permissions, and where the download buttons appear
- Filters Reference — every filter this plugin exposes, with examples
- Changelog — full version history