• Resolved Sandy Price

    (@pycawnings)


    WooCommerce PDF Invoices & Packing Slips – Trying to figure out how to mark the invoice as paid when I change the status to in process. I am not sure if this plugin has that option.

    The page I need help with: [log in to see the link]

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

    (@kluver)

    Hi @pycawnings,

    You can add the following code snippet to the functions.php of your child theme:

    add_filter( 'wpo_wcpdf_invoice_title', 'wpo_wcpdf_invoice_mark_as_paid_on_status_processing_or_completed', 10, 2 );
    function wpo_wcpdf_invoice_mark_as_paid_on_status_processing_or_completed ( $title, $document = null ) { 
    	if ( !empty($document) && !empty($document->order) ) {
    		$statuses = array('processing', 'completed');
    		if ( in_array( $document->order->get_status(), $statuses ) ) {
    			$title .= ' - PAID';
    		}
    	}
    	return $title;    
    }

    This will add ‘- PAID’ to the document title when an order status is ‘processing’ or ‘completed’.

    If you haven’t worked with code snippets or functions.php before please read this: How to use filters

    Thread Starter Sandy Price

    (@pycawnings)

    Thank you!

    Thread Starter Sandy Price

    (@pycawnings)

    Tried it and it works- Thanks 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Mark as paid’ is closed to new replies.