• Resolved chris83210

    (@chris83210)


    Hi,

    I’m writting a plugin that has to send PDF invoice over FTP for some orders.
    Is there a way to generate and get invoice file by code ?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! You can generate an invoice for an order with the wcpdf_get_document function, like so:

    
    $invoice = wcpdf_get_document( 'invoice', $order, true );
    $pdf_data = $invoice->get_pdf();
    // store the PDF data in a file using file_put_contents for example or stream directly
    

    Good luck!

Viewing 1 replies (of 1 total)
  • The topic ‘Get Invoice file’ is closed to new replies.