• Hi

    I’ve just started to get this Fatal Error message when I try to print invoice directly from website

    Fatal error: Call to a member function get_option_value_from_array() on null
    #0 /home/images52/public_html/wp-includes/class-wp-hook.php(287): tracking_display_in_invoice(‘invoice’, Object(Automattic\WooCommerce\Admin\Overrides\Order))
    #1 /home/images52/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #2 /home/images52/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/images52/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple/invoice.php(83): do_action(‘wpo_wcpdf_befor…’, ‘invoice’, Object(Automattic\WooCommerce\Admin\Overrides\Order))
    #4 /home/images52/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(787): include(‘/home/images52/…’)
    #5 /home/images52/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(691): WPO\WC\PDF_Invoices\Documents\Order_Document->render_template(‘/home/images52/…’, Array)
    #6 /home/images52/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(673): WPO\WC\PDF_Invoices\Documents\Order_Document->get_html()
    #7 /home/images52/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(709): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf()
    #8 /home/images52/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(340): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf(‘download’)
    #9 /home/images52/public_html/wp-includes/class-wp-hook.php(287): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax(”)
    #10 /home/images52/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #11 /home/images52/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #12 /home/images52/public_html/wp-admin/admin-ajax.php(175): do_action(‘wp_ajax_generat…’)
    #13 {main}

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! This seems to be coming from a function tracking_display_in_invoice, which could be either from a third party plugin or from custom code that was added to your site. Is this code you have added yourself or are you using any plugins that may be adding tracking information to the invoice?

    Thread Starter Jerry Nairn

    (@jerry-nairn)

    Hi
    I was actually wondering if this was the cuplrit.

    I added – WooCommerce PDF Invoices & Packing Slips plugin
    Below is the code snippet for add tracking information in invoice and packing slip PDF generate by this plugin.

    I’ve added this into
    woocommerce-pdf-invoices-packing-slips/templates/Simple/template-functions.php

    is this incorrect?

    Plugin Contributor Ewout

    (@pomegranate)

    You forgot to include the code snippet!

    Additionally, adding it to woocommerce-pdf-invoices-packing-slips/templates/Simple/template-functions.php directly is not bad per se, but that file will be overwritten when there are plugin updates. There are various other ways to do this:

    1. If you have a child theme, you can include it in your theme functions.php
    2. If you have a child theme and you also made other edits to the invoice.php and/or packing-slip.php templates, you should copy them to your theme following these instructions.
    3. If you don’t have a child theme, you can use a plugin like Code Snippets
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘fatal error when trying to print Invoice’ is closed to new replies.