• Resolved colorito

    (@colorito)


    Is it possible to change the order status to completed after downloading the Packing slip / print it? Maybe in conjunction with another plugin?

Viewing 1 replies (of 1 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @colorito

    Yes, that should be possible using the code snippet below:

    add_action( 'wpo_wcpdf_init_document', function( $document ) {
    	if ( ! empty( $order = $document->order ) && $document->get_type() == 'packing-slip' ) {
    		$order->set_status( 'completed' ); // change 'completed' to the preferred one
    		$order->save();
    	}
    } );

    If you never worked with actions/filters please read this documentation page.

Viewing 1 replies (of 1 total)
  • The topic ‘Change order status after PDF download or print’ is closed to new replies.