Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter andreas83b

    (@andreas83b)

    let me answer my own question:

    require_once( ‘wp-load.php’ );
    $wpo_wcpdf = new WooCommerce_PDF_Invoices();
    $wpo_wcpdf->load_classes();
    $pdf = $wpo_wcpdf->export->get_pdf(“packing-slip”, array(“1129”));
    file_put_contents( “invoice.pdf”, $pdf);

    this works for me.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! That’s correct. The Export class doesn’t work on it’s own. I’m working on restructuring the plugin architecture (it was originally a fork of another plugin), which will make stuff like this much easier. Until then – this should work fine.

    Happy coding! 🙂
    Ewout

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Run from CLI’ is closed to new replies.