• Resolved astral4ik

    (@astral4ik)


    Hi.

    I try to put DOCUMENT NOTES to the packing slips too. Now it shows only on invoices.

    I put it to the packing-slip.php

    <div class="document-notes">
                    <?php do_action( 'wpo_wcpdf_before_document_notes', $this->get_type(), $this->order ); ?>
                    <?php if ( $this->get_document_notes() ) : ?>
                        <h3><?php _e( 'Notes', 'woocommerce-pdf-invoices-packing-slips' ); ?></h3>
                        <?php $this->document_notes(); ?>
                    <?php endif; ?>
                    <?php do_action( 'wpo_wcpdf_after_document_notes', $this->get_type(), $this->order ); ?>
                </div>

    dut it doesnt work for me.

    Any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    Hello @astral4ik,

    Are you using a custom PDF template (created by you)? If that is not your objective, you should use our available Action and Filter Hooks. ??
    If you modify the plugin files directly, your changes will be lost on the next plugin update. ??

    For your purpose, we will use an Action Hook.

    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_order_notes', 10, 2 );
    function wpo_wcpdf_order_notes ( $template_type, $order ) {
        if ( $template_type == 'packing-slip' ) {
            $document = wcpdf_get_document( $template_type, $order );
            $document->order_notes();
        }
    }

    Documentation: Displaying Order Notes with a Template Hook

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide:?How to use Hooks

    • This reply was modified 1 year, 3 months ago by Darren Peyou. Reason: correction, more permalinks
    Thread Starter astral4ik

    (@astral4ik)

    So it doesnt work for me

    I need DOCUMENT NOTES to packing slips. Order notes (what customers write onto order) works well and shows. Document notes are what the administrator writes in the order. I need to packing slips shows it for our paching workers.

    so i modified your snippet

    add_action( ‘wpo_wcpdf_after_customer_notes’, ‘wpo_wcpdf_DOCUMENT_notes’, 10, 2 );
    function wpo_wcpdf_DOCUMENT_notes ( $template_type, $order ) {
    if ( $template_type == ‘packing-slip’ ) {
    $document = wcpdf_get_document( $template_type, $order );
    $document->DOCUMENT_notes();
    }
    }

    but it doesnt work for me

    It shows in INVOICE, but i need it ti shows in the PACKING SLIPS too

    Plugin Contributor dwpriv

    (@dwpriv)

    You can try this updated snippet

    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_order_notes', 10, 2 );
    function wpo_wcpdf_order_notes ( $template_type, $order ) {
        if ( $template_type == 'packing-slip' ) {
            $document = wcpdf_get_document( 'invoice', $order );
            echo $document->document_notes();
        }
    }

    Let us know how it works for you

    Thread Starter astral4ik

    (@astral4ik)

    YES! Thanks a lot!

    Plugin Contributor Darren Peyou

    (@dpeyou)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Document notes on packing slips’ is closed to new replies.