Generating PDF documents from the store
An invoice that must carry a particular wording, a picking slip suited to the workshop, a label in the carrier’s format, a quote sent before the order: document generation is one of the most frequent needs and one of the most misjudged, because the difficulty isn’t where people expect.
The typical need
Requests fall into three families. Changing an existing document: adding legal wording to the invoice, showing an internal reference, altering how lines are laid out. Creating a document that doesn’t exist: picking slip, workshop sheet, parcel label, certificate. Producing a document outside the order cycle: a quote, a customer summary, a periodic statement.
The first two lean on the store’s own mechanisms, which already produce PDFs and offer editable templates. The third asks more, because you must decide where the document is stored, who can view it and how long it is kept.
How I approach this kind of work
I start from the templates the platform provides rather than an independent generator. PrestaShop produces its invoices and delivery notes from templates that can be overridden from the theme, which allows a mention to be added or a table reorganised without touching the core or losing the change at update time. That approach has a limit: it follows the original document’s structure, and a full layout redesign sometimes amounts to writing a new document.
The real work sits elsewhere. First in the data: a document reflects the order’s state at issue time, and that state must not change if the product is edited later. Then in the rendering: a missing font, a badly encoded accented character or an oversized image produce a degraded document with no error shown. Finally in imposed formats: a carrier label follows dimensions and content defined by the carrier, not by you.
I always check the printed result and not just the on-screen view, because that is where column overflow and margins cutting a mandatory mention become visible.
Related pages
-
Invoice display and template problems
Common symptoms on PrestaShop when the invoice doesn’t come out as expected.
-
Automated PDF quotes
A delivered project on producing documents outside the order cycle.
-
Adding a product or order field
When the wording to show on the document doesn’t exist in the store yet.
Frequently asked questions
Can the invoice be changed without risking a compliance problem?
Do already issued documents change if I edit the template?
Why do my accented characters render badly in the PDF?
Can the document be emailed automatically?
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.