Last active
July 7, 2025 06:53
-
-
Save woogists/06bdf33b9dd3401a89d0cc39288a3646 to your computer and use it in GitHub Desktop.
[WooCommerce Xero] Send orders as Draft Invoices rather than Awaiting Payment
This file contains hidden or 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 | |
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