4

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.

5

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 – user568458 Sep 11 '16 at 13:04
  • Any idea on the preprocess function for this theme registered under billy ? – Hardik Rawal Sep 6 '17 at 12:35
1

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, privacy policy and cookie policy

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