Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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