• Resolved adamshakebiz06

    (@adamshakebiz06)


    Dear,

    I use the following code to generate the invoice and i didn’t manage to make it work, I have the following error from my code :

    Error: Call to a member function get_document() on null

    The php code is the following :

    include_once(WP_PLUGIN_DIR . "/woocommerce-pdf-invoices-packing-slips/woocommerce-pdf-invoices-packingslips.php");
        include_once(WP_PLUGIN_DIR . "/woocommerce-pdf-invoices-packing-slips/woocommerce-pdf-invoices-packingslips.php");
        include_once(WP_PLUGIN_DIR . "/woocommerce-pdf-invoices-packing-slips/includes/wcpdf-functions.php");
    
    
        $order = wc_get_order(101618);
    
        if ( !$order ) {
            // Handle the case where the order doesn't exist
            echo 'Order not found';
            exit;
        }
    
        $invoice = wcpdf_get_document( 'invoice', $order, true );

    Could you help me please it’s very urgent.

    Kind regards

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Error Error: Call to a member function get_document() on null’ is closed to new replies.