• Hi there,

    I have a question , i don’t want to create PDF invoice for all Orders. Wir have two place to deliver our product and we want to create PDF invoice just for One Place. Is it possible?

    Best regards

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

    (@kluver)

    Hi @nimashahin,

    That is certainly possible. You can block invoice creation (automatic and manual) with a small code snippet. In the below example I prevent invoice creation by checking the shipping company but you can use all kinds of order data to determine for which orders an invoice can be created:

    add_filter( 'wpo_wcpdf_document_is_allowed', 'wpo_wcpdf_document_is_allowed', 10, 2 );
    function wpo_wcpdf_document_is_allowed ( $condition, $document ) {
    	if( $document->type == 'invoice' && $order = $document->order ) {
    		if ( $order->get_shipping_company() == 'Any Company' ) { 
    			return false;
    		}
    	}
    	return $condition;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Create Invoice for only one delivery location’ is closed to new replies.