• Resolved mightymouse3062

    (@mightymouse3062)


    I am looking to customize the packing slip by adding a second page with some additional packing information.

    I already have a method in my functions.php with the all of the information, but I cannot figure out how to add a new page using the filter hooks.

    I have tried adding the new page content, “<div style=”page-break-before: always;”></div>” (https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/inserting-a-page-break/), however that did not seem to work.

    Is there a way to append a new page with just text to the end of the generated packing slip with the filter hooks?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @mightymouse3062

    Please try adding this to your functions.php file:

    add_action('wpo_wcpdf_after_document', 'wpo_wcpdf_add_custom_page', 10, 2);
    function wpo_wcpdf_add_custom_page( $document_type, $order )
    {
    	if( !empty($order) && $document_type == 'invoice' ) {
    		?>
    		<div style="page-break-before: always;">My custom test</div>
    		<?php
    	}
    }

    Alternatively in our Professional extension you have the ability to add static files to documents.

    Captura-de-ecra-2020-06-18-a-s-08-39-28

    Thread Starter mightymouse3062

    (@mightymouse3062)

    That did the trick. Thank you very much for the assistance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Additional Page through Filter Hooks’ is closed to new replies.