Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Outputting private order notes to the packing slip

  • Resolved Phenotype_X

    (@phenotype_x)


    I am currently successfully outputting the customer note to the packing slip using the following code in the template:

    wcpdf_get_document( $this->type, $this->order )->order_notes();

    Is it possible to output the private note instead? I had a look at the plugin code and tried this, but it doesn’t print anything:

    wcpdf_get_document( $this->type, $this->order )->get_order_notes(‘private’);

    Thanks for the amazing plugin!

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

    (@pomegranate)

    I tested this, but it works as expected for me. The reloading of the document object is not necessary, $this is the document object 🙂

    This worked for me:

    
    <?php $this->order_notes('private'); ?>
    

    I noticed that you used the get_order_notes() method in the second call, which returns the notes html, the first call (order_notes()) is an output method, so this is probably why it didn’t work for you!

    Thread Starter Phenotype_X

    (@phenotype_x)

    Ahh thanks, yes that works!

    I’m guessing there’s no way to filter for just the manually added private notes?

    Plugin Author Ewout

    (@pomegranate)

    yes there is 🙂
    I actually just added this while cleaning up the code: https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips/commit/f3350eebabfe34a9a5820e3ed8dcada50409d7a6

    With that in place you can either set $include_system_notes to false, or use the CSS class added to the notes (system-note) to hide it.

    
    <?php $this->order_notes('private', false); ?>
    

    I’ll probably release this monday or tuesday.

    Thread Starter Phenotype_X

    (@phenotype_x)

    That’s amazing. I’ll keep an eye out for the release next week.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Outputting private order notes to the packing slip’ is closed to new replies.