Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdados/7f61dc21cdbbb9cd750c3a81397ef916 to your computer and use it in GitHub Desktop.
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
<?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