• Resolved Bruno

    (@bsa1991)


    Hello, is it possible to add the order number next to the Invoice title?
    Example:

    Logo
    Invoice #4452
    Adress

    Tks.

    • This topic was modified 4 years, 2 months ago by Bruno.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @bsa1991

    Yes, should be possible by adding the code snippet below to your theme functions.php file:

    add_action( 'wpo_wcpdf_after_document_label', function( $document_type, $order ) {
    	if( ! empty($order) && $document_type == 'invoice' ) {
    		?>
    		<style>
    			.invoice .document-type-label {
    				display: none;
    			}
    		</style>
    		<?php
    		$document = wcpdf_get_document( $document_type, $order );
    		echo '<h1>'.$document->get_title().' '.$document->get_invoice_number().'</h1>';
    	}
    }, 10, 2 );

    If you never worked with actions/filters please read this documentation page: How to use filters

    Thread Starter Bruno

    (@bsa1991)

    Hello @alexmigf it worked!

    But this invoice 1…2…3 …
    I would like order number #443… #442…

    It’s possible?

    Thread Starter Bruno

    (@bsa1991)

    Hey @alexmigf Solved! I made a change.
    Thanks!

    ‘.$document->get_invoice_number()

    for

    ‘.$document->get_order_number()

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Order number in title’ is closed to new replies.