• Resolved Vijay

    (@vijaydj)


    Hi,
    iam looking for any action or filter to get when the invoice is generated for the very first time by clicking the invoice button in admin and in bulk action
    I am trying to change the order status dynamically then the user will know the order status.
    Could you please help me out here?
    thankyou.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @vijaydj

    You want to change the order status when generating the PDF document is that right?

    Let me know.

    Thread Starter Vijay

    (@vijaydj)

    hi @alexmigf
    exactly, but only when the first time the invoice number is generated, not all the time when the pdf button is clicked to view the invoice.
    it will be great if I could do this.
    thanks.

    Plugin Contributor Ewout

    (@pomegranate)

    You can use the wpo_wcpdf_init_document hook. It executes for all documents but you can specifically target the invoice like so:

    
    add_action( 'wpo_wcpdf_init_document', 'wpo_wcpdf_invoice_created', 10, 1 );
    function wpo_wcpdf_invoice_created( $document ) {
    	if ($document->get_type() == 'invoice' ) {
    		// do you thang
    	}
    }
    
    Thread Starter Vijay

    (@vijaydj)

    thankyou, it worked

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add a custom hook on first time invoice genreated’ is closed to new replies.