Adding a print-run position counter to a custom packing slip template
What it does
Two placeholders are now available in every custom HTML packing slip template:
| Placeholder | What it contains |
|---|---|
{{documentNumber}} | This slip's position within the current print run, starting at 1 |
{{documentCount}} | Total number of slips in the print run |
Both are plain integers — no currency or date formatting. A template that does not reference them is byte-identical to before.
Why the count is accurate on split orders
The counter is calculated after all per-shipment and per-carton expansions have run, so documentCount reflects the number of slips actually rendered — not the number of orders you selected. If you select 3 orders but one of them fans out into 2 shipment slips, documentCount will be 4, not 3.
Typical usage
Add the counter anywhere in your header or footer section:
<span>Slip {{documentNumber}} of {{documentCount}}</span>
Or use it to show a box-check style indicator:
<div class="slip-counter">Packing Slip {{documentNumber}} / {{documentCount}}</div>
Single-document prints
When printing one slip at a time, documentNumber is 1 and documentCount is 1, so a counter like 1 of 1 will appear. If you want to hide the counter for single-document prints, you can use a Mustache conditional — note that Mustache treats the integer 1 as truthy, so a simple {{#documentCount}} block will always render. For a "hide when only one" pattern, consider an approach like:
{{#documentCount}}
<!-- always shown; documentCount is always ≥ 1 -->
Slip {{documentNumber}} of {{documentCount}}
{{/documentCount}}
Most teams leave the counter visible even for single-slip prints, as it confirms completeness.
Where to edit your template
- Go to Manage → Templates.
- Find your packing slip template (type Packing Slip), click ⋮, and choose Edit.
- In the Header HTML or Footer HTML section, click Insert Placeholder. Open Document Position in Print Run and add {{documentNumber}} and {{documentCount}}.
- Click Save.
Related placeholders
For a full list of available packing slip placeholders, refer to the What placeholder variables are available in Sales Order document templates? article in this knowledge base.