Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Last active October 16, 2017 12:19
Show Gist options
  • Save Willem-Siebe/cf8474b5ca4e72880a04 to your computer and use it in GitHub Desktop.
Save Willem-Siebe/cf8474b5ca4e72880a04 to your computer and use it in GitHub Desktop.
Add the three custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see http://wordpress.org/support/topic/adding-text-field-below-the-table.
<!-- Add the first custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. -->
<?php if ( $wpo_wcpdf->get_extra_1() ): ?>
<div id="extra1">
<?php $wpo_wcpdf->extra_1(); ?>
</div>
<?php endif; ?>
<!-- Add the second custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. -->
<?php if ( $wpo_wcpdf->get_extra_2() ): ?>
<div id="extra2">
<?php $wpo_wcpdf->extra_2(); ?>
</div>
<?php endif; ?>
<!-- Add the third custom fields available in WooCommerce PDF Invoices & Packing Slips to your own custom invoice template, see https://gist.github.com/Willem-Siebe/cf8474b5ca4e72880a04. -->
<?php if ( $wpo_wcpdf->get_extra_3() ): ?>
<div id="extra3">
<?php $wpo_wcpdf->extra_3(); ?>
</div>
<?php endif; ?>
@PhilipsEkuma
Copy link

Breaks website for me. Outputs only HTML without styling. Uncaught error: Call to a member function extra_1() on null in ...

@PhilipsEkuma
Copy link

Finally solved it by replacing $wpo_wcpdf->extra_1() with $this->wcpdf->extra_1().

@sebvandijk
Copy link

Thanks for your contribution PhilipsEkuma, worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment