Skip to main content

Sales Order template reference

The Sales Order template is the customer-facing invoice for an order — the document you print or send once the order exists. The page itself is titled Sales Invoice.

It shows the order as the customer placed it: prices, discounts, tax, charges and the order total. It's applied wherever an invoice PDF is produced for an order, using that order's store copy where one exists.

Order details, shipping and status

Order Meta gives you:

Order Number · Order Date (plain year-month-day) · Customer PO Number · Currency Code · Shipping Method · Ship Via · Ship By Date · Deliver By Date · Tracking Numbers · Payment Status · Fulfillment Status.

Two things worth knowing:

  • Customer PO Number is the reference the customer gave you for their own purchasing. It's nothing to do with your supplier-side purchase orders.
  • Ship Via is simply another name for Shipping Method, kept so older templates keep working. Use one or the other, never both in the same spot.

Shipping Method resolves to the mapped carrier service name, falling back to whatever the customer requested.

You can also print the store block (name, logo, full address with phone and email), the customer (name, email, phone), and separate Billing Address and Shipping Address blocks.

Line items

Inside the Items loop each line exposes:

SKU · MPN · Brand · Description · Quantity · Price · Line Total · Barcode · a sizing note · a per-line Discount · serial numbers · the quantity-tier helpers used for colour-coding multi-unit lines.

  • Quantity is a whole number.
  • Price and Line Total are already formatted to two decimals.
  • Line Total already reflects that line's discount.

The amounts are pre-calculated. The template language has no arithmetic — see How PDF templates work.

Non-product charges

Charges that aren't products — shipping revenue, handling fees, gift wrap, surcharges — live in a separate Financial Lines loop giving Description, Quantity, Amount, Line Total, the charge's Type, and whether it's revenue or cost.

Those amounts are already inside the order Total

Printing them breaks the total down; it doesn't add to it. Adding them onto the Total yourself would double-count.

Gate the section with the Has Financial Lines switch so orders without extra charges don't print an empty table.

Totals

Totals gives you Total Units, Subtotal, Discount, Tax, Tax (Included), Shipping and Total — all pre-formatted to two decimals.

FigureWhat it is
SubtotalThe product lines before tax, discount and shipping.
TotalThe grand total, with tax, shipping and other charges folded in and the discount taken off.
Total UnitsThe sum of the product line quantities.

Getting the tax row right

An order is either tax-exclusive (tax added on top) or tax-inclusive (tax already in the prices), and you must print a different row for each.

Two ready-made switches handle it: Tax Row Display and Tax-Included Row Display. Each returns the right show/hide value for its own row, so exactly one of the two appears. Alternatively, wrap each row in the Tax Is Included conditional yourself.

Pair either approach with Has Tax so a tax-free order shows no tax row at all.

The show-only-when switches

Under Conditional Flags a Sales Order gets:

Has Items · Has Tax · Has Discount · Tax Is Included · Has Shipping · Has Financial Lines.

Wrap any part of the page in one to make it appear only when relevant — the Discount row only when a discount was applied, the charges table only when there are charges.

Each has an opposite form for printing alternative wording when the switch is off, which is how you produce an "order pending" message on an order with no lines.

What the stock template contains

  • a header reading Sales Invoice with your store name and address
  • a boxed invoice number and date
  • a Customer box holding the billing address, and a Ship To box holding the shipping recipient
  • a Ship Via box
  • the automatic line-items table
  • a totals block: Total Units, Subtotal, Discount, one of the two tax rows, then a bold Total

It does not print non-product charges, tracking numbers, payment or fulfillment status, or the customer memo. Add those yourself if you need them.

Its sections are cleanly separated blocks of markup, so moving one — the totals above the items table, say — is a cut and paste in the code editor. See Edit a template.

Next steps

Last verified: