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 woogists/457769ebf0b95e4cc8f28218661f15e4 to your computer and use it in GitHub Desktop.
Save woogists/457769ebf0b95e4cc8f28218661f15e4 to your computer and use it in GitHub Desktop.
Replace Xero's default Order Created date with today's date
<?php
add_filter('woocommerce_xero_invoice_date', 'change_xero_invoice_date_to_current_date', 10, 1);
add_filter('woocommerce_xero_invoice_due_date', 'change_xero_invoice_date_to_current_date', 10, 1);
function change_xero_invoice_date_to_current_date($date) {
// Get today's date in YYYY-MM-DD format
$today = date('Y-m-d');
// Return today's date instead of the original invoice/payment due date
return $today;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment