Skip to content

Instantly share code, notes, and snippets.

@webdados
Last active August 11, 2019 08:37
Show Gist options
  • Save webdados/3bf2fbf5406d9b6412cd12375ad51a0f to your computer and use it in GitHub Desktop.
Save webdados/3bf2fbf5406d9b6412cd12375ad51a0f to your computer and use it in GitHub Desktop.
Configure scheduling of automatic documents on Invoicing with InvoiceXpress for WooCommerce
<?php
/* Schedule invoicing documents */
add_filter( 'invoicexpress_woocommerce_delay_automatic_invoice', '__return_true' );
add_filter( 'invoicexpress_woocommerce_delay_automatic_invoice_time', function() {
return 'PT2M'; //2 minutes
});
/* Schedule transport guides */
add_filter( 'invoicexpress_woocommerce_delay_automatic_guide', '__return_true' );
add_filter( 'invoicexpress_woocommerce_delay_automatic_guide_time', function() {
return 'PT2M'; //2 minutes
});
/*
* DateInterval formats - https://www.webfx.com/blog/web-design/php-dateinterval-class/
* 'PT2M' - 2 minutes
* 'PT2H' - 2 hours
* 'P2D' - 2 days
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment