-
Notifications
You must be signed in to change notification settings - Fork 1
Delivery Notes
“SilentJMA” edited this page Jun 18, 2026
·
1 revision
The plugin includes a built-in PDF generator that creates delivery and return notes for Mirakl orders — no external service required.
- On the WooCommerce order edit page, click Delivery Note in the Mirakl Actions section
- The PDF is generated locally on your server using Dompdf (HTML → PDF)
- The PDF is served inline in the browser for download/printing
| Component | File | Purpose |
|---|---|---|
| Handler |
includes/class-mirakl-admin.php (handle_delivery_note_pdf()) |
Admin-post action dispatcher |
| Order Data | src/DeliveryNote/OrderData.php |
Extracts order data from WC_Order
|
| Generator | src/DeliveryNote/Generator.php |
Dompdf-based PDF rendering |
The flow:
- User clicks "Delivery Note" → URL:
admin-post.php?action=mirakl_delivery_note&order_id=N&store_name=StoreName -
handle_delivery_note_pdf()gates access (manage_woocommercecap +_mirakl_order_idmeta check) - Creates
OrderData::from_wc_order()with the WooCommerce order, store name, and channel code - Instantiates
new Generator($data)which resolves the store's language setting -
$generator->output()renders the PDF inline
Configured in Mirakl → Stores, under the Delivery Note section:
| Setting | Description |
|---|---|
| Logo | Upload via WordPress Media Library. Auto-resized to 200×70 px PNG with transparency preserved. |
| Language | Choose: Deutsch, English, Français, Nederlands, Español |
| Footer | Custom footer text. Falls back to language-specific default if left empty. |
- Uploaded through the WordPress Media Library (attachment ID stored per store)
- Auto-resized to 200×70 px on save using GD (
imagecreatefromstring+imagecopyresampled) - Transparency is preserved (PNG output with alpha blending)
- Falls back to original if GD is unavailable
- Base64 data is pre-computed at save time (not at render time) to avoid filesystem/symlink issues
| Language | Code | Default Title |
|---|---|---|
| German | de |
Lieferschein / Retourenschein |
| English | en |
Delivery Note / Return Note |
| French | fr |
Bon de Livraison / Bon de Retour |
| Dutch | nl |
Leveringsbon / Retourbon |
| Spanish | es |
Albarán de Entrega / Nota de Devolución |
- Title — 16pt bold, translated per language
- Store Logo — 200×70 px, right side beside title
- Address — Left-aligned shipping address
- Order Info — Right-aligned table: order number, partner order, order date, delivery note date
- Product Table — 6 columns: Pos., Quantity, SKU, Description, Return Qty, Return Reason
- Return Codes — 3-column grid of return reason codes
- Return Instructions — Numbered list with important notes
- Footer — Fixed-position at page bottom
- Pure black & white (no colors)
- A4 portrait, margins: 13mm 18mm 22mm 18mm
In Mirakl → Stores → Advanced Channel Config, you can configure:
- URL Template — A custom URL per store+channel for external delivery note services
- Button Label — Custom label for the delivery note button
- Enabled — Toggle on/off per channel
When configured, the custom URL template opens instead of the built-in PDF generator. Template variables: {order_id}, {store_name}, {channel_code}.