Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active July 7, 2025 06:53
Show Gist options
  • Save woogists/06bdf33b9dd3401a89d0cc39288a3646 to your computer and use it in GitHub Desktop.
Save woogists/06bdf33b9dd3401a89d0cc39288a3646 to your computer and use it in GitHub Desktop.
[WooCommerce Xero] Send orders as Draft Invoices rather than Awaiting Payment
<?php
add_filter( 'woocommerce_xero_invoice_to_xml', 'change_xero_invoice_status_to_draft' );
function change_xero_invoice_status_to_draft($xml) {
// Search the XML data for AUTHORISED and replace with DRAFT
$xml = str_replace( 'AUTHORISED' , 'DRAFT' , $xml);
// Return the modified data
return $xml;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment