Support » Plugin: WooCommerce PDF Invoices & Packing Slips » How to Disable Packing Slip for unpaid Orders

  • Resolved skot77

    (@skot77)


    I have tried with all options available and want to know how we can disable printing packing slip for orders that have not been paid.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support alexmigf

    (@alexmigf)

    Hello @skot77

    Please add the following code snippet to your theme functions.php file:

    add_filter('wpo_wcpdf_document_is_allowed', function( $allowed, $document )
    {
    	if ( ! empty($order = $document->order) && $document->get_type() == 'packing-slip' ) {
    		if ( ! $order->is_paid() ) {
    			$allowed = false;
    		}
    	}
    	return $allowed;
    }, 10, 2 );

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

    Thread Starter skot77

    (@skot77)

    This was really a great help because printing a packing slip in my side means order is to be shipped. You saved us. Thanks and God Bless you.

    Plugin Support alexmigf

    (@alexmigf)

    You’re welcome 🙂

    Have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Disable Packing Slip for unpaid Orders’ is closed to new replies.