I have installed Commerce Billy module on my website.

Then upon ordering I get this PDF with this layout.enter image description here

But I want to change the table displayed, because I've created some custom fields in it and I want to display it also in the table.

Any help will be greatly appreciated.

2 Answers 2


This table is actually the rendered view 'Line items (Commerce Line Item)' which is created in code by Drupal Commerce. So all you have to do is to modify this view to your needs.

To further customize the display of your invoice, you can make a copy of css/pdf.css and themes/commerce_order--commerce_order--pdf.tpl.php located in commerce_billy_pdf folder into your custom theme and experiment.

  • 1
    Great answer. Small note, the folder name in the billy module folder is now template not theme. Do you know how to preview the template as HTML before it's passed to the PDF generator? If you do I've asked that as a follow-up question here Sep 11, 2016 at 13:04
  • Any idea on the preprocess function for this theme registered under billy ? Sep 6, 2017 at 12:35

If you'd like to display field output from custom fields, the simplest way is to put tokens in one of the admin/commerce/config/billy-invoice/pdf text areas. I regularly place the pdf footer text in the commerce_order--commerce_order--pdf.tpl.php and use the footer text area to place text and tokens like Customer ID: [current-user:field-customer-id] and do the styling and placement via CSS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.