• Resolved luisdesousa

    (@luisdesousa)


    Hello there!. I removed a product that will no longer be sold in the store but now I cannot see the invoices for the orders in which that product was sold. When trying to see any of the invoices where that product was sold I get a “Fatal error: Call to a member function get_id () on null”.

    Why after deleting a product the order still exists but the invoice produces a fatal error?

    Thanks in advance

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

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

    (@pomegranate)

    Our plugin doesn’t try getting the ID for deleted products out of the box, so I suspect there’s custom or third party plugin code that is trying to call this. Can you share the full error (the so called “stacktrace” with all the files/lines leading up to it)?

    Thread Starter luisdesousa

    (@luisdesousa)

    Hi Ewout. Thanks for responding and thanks for this wonderful plugin.
    The full error is:

    Fatal error: Call to a member function get_id() on null
    #0 /home/customer/www/bedentalexpert.com/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(841): include()
    #1 /home/customer/www/bedentalexpert.com/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(745): WPO\WC\PDF_Invoices\Documents\Order_Document->render_template(‘/home/customer/…’, Array)
    #2 /home/customer/www/bedentalexpert.com/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(727): WPO\WC\PDF_Invoices\Documents\Order_Document->get_html()
    #3 /home/customer/www/bedentalexpert.com/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(763): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf()
    #4 /home/customer/www/bedentalexpert.com/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(376): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf(‘inline’)
    #5 /home/customer/www/bedentalexpert.com/public_html/wp-includes/class-wp-hook.php(303): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax(”)
    #6 /home/customer/www/bedentalexpert.com/public_html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(”, Array)
    #7 /home/customer/www/bedentalexpert.com/public_html/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
    #8 /home/customer/www/bedentalexpert.com/public_html/wp-admin/admin-ajax.php(187): do_action(‘wp_ajax_generat…’)
    #9 {main}

    Best regards

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @luisdesousa,

    Are you using a custom template? If so, try switching to the Simple template temporarily, under WooCommerce > PDF Invoices > General > Choose a template, and then open the PDF invoice to check if it works this time.

    Thread Starter luisdesousa

    (@luisdesousa)

    Hi! Jordan. Indeed, the problem is due to my custom template. When changing it to the Simple template the error disappears. I’m going to check where the problem is in my template.

    Thank you very much for your help. I think this topic can be considered resolved.

    Kind regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error after deleting the invoiced product.’ is closed to new replies.