• Resolved nemovich

    (@nemovich)


    Hello,

    I was wondering if it was possible to add an extra page at the end of every document ? we need to include our terms & conditions with the document and it’s pretty long for the footer or extra fields.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @nemovich,

    Will your Term & Conditions be the same for all your orders/PDF documents?

    Thread Starter nemovich

    (@nemovich)

    Hi @yordansoares

    Yes, it’ll be the same. No need to complicate things.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Sorry for the late reply @nemovich!

    For your specific case, the easy way is to use the customizer, included in Premium Templates, to add a custom block like this:

    However, since I’ve kept you waiting so long, I’ve written a code snippet, as a courtesy, that does the same thing:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Adds a Terms & Conditions text in a new page 
     */
    add_action( 'wpo_wcpdf_after_document', function( $document_type, $order ) {
        ?>
        <div style="page-break-before: always;"></div>
        <div class="terms-and-conditions">
            <h3>Terms & Conditions</h3>
            <p>Your Terms & Conditions goes here!</p>
        </div>
        <?php
    }, 10, 2 );

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

    In brief, if you have a child theme, you can add code snippets in its functions.php file: don’t add code snippets to the functions.php file from your parent theme, because you may lose your customizations after updating your parent theme! The another way to add code snippets, that is safer in my humble opinion, is to use the Code Snippets plugin: This plugin stores the code snippets in your database, so you don’t have to worry about losing your customizations after updating your plugins or theme ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add an extra page at the end of document’ is closed to new replies.