Created
March 8, 2021 17:48
-
-
Save webdados/7f61dc21cdbbb9cd750c3a81397ef916 to your computer and use it in GitHub Desktop.
Get AT Code 2 minutes after issuing Delivery Note with Invoicing with InvoiceXpress for WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Get AT Code 2 minutes after issuing Delivery Note - WordPress crons need to be running properly */ | |
add_action( 'invoicexpress_woocommerce_after_document_finish', function( $order_id, $type ) { | |
if ( $type == 'transport_guide' ) { | |
$minutes = 2; | |
wp_schedule_single_event( time() + ( $minutes * 60 ), 'invoicexpress_woocommerce_fetch_at_code', array( $order_id ) ); | |
} | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment