Fatal error: Call to a member function get_header_logo_id() on null

Hi there,

Since I updated the plugin of our client to the newest version, both the buttons for making an invoice PDF and packing slip PDF throw the same error (Fatal error: Call to a member function get_header_logo_id() on null).

Fatal error: Call to a member function get_header_logo_id() on null/home/sed029/domains/SITENAME/public_html/wp-content/themes/SITETHEME/woocommerce/pdf/SITENAME/packing-slip.php (6)
#0 /home/sed029/domains/SITENAME/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(976): include()
#1 /home/sed029/domains/SITENAME/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(879): WPO\WC\PDF_Invoices\Documents\Order_Document->render_template()
#2 /home/sed029/domains/SITENAME/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(834): WPO\WC\PDF_Invoices\Documents\Order_Document->get_html()
#3 /home/sed029/domains/SITENAME/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(901): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf()
#4 /home/sed029/domains/SITENAME/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(466): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf()
#5 /home/sed029/domains/SITENAME/public_html/wp-includes/class-wp-hook.php(310): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax()
#6 /home/sed029/domains/SITENAME/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#7 /home/sed029/domains/SITENAME/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /home/sed029/domains/SITENAME/public_html/wp-admin/admin-ajax.php(188): do_action()
#9 {main}

After looking into it a little, we can see that the error comes from this particular piece of code in both custom template files packing-slip.php and invoice.php:

if( $wpo_wcpdf->get_header_logo_id() ){
} else {			
	echo apply_filters( 'wpo_wcpdf_invoice_title', __( 'Invoice', 'wpo_wcpdf' ) );

I already saw a few posts on this forum about a few errors/notices because of using deprecated code from old WooCommerce versions, so my question is this:

Would you guys be willing to supply me the newer version of this piece of code? If you need the full template file(s) .php or more info, please let me know.

Thanks for your time!

  • This topic was modified 48 minutes ago by Brian.
  • This topic was modified 33 minutes ago by Brian. Reason: Added full fatal error notice
  • This topic was modified 14 minutes ago by Yui.


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer