Skip to content

Instantly share code, notes, and snippets.

@dennisnissle
Created December 18, 2023 14:13
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 dennisnissle/2583eba6e2f7ad3efe817d9aaaf91392 to your computer and use it in GitHub Desktop.
Save dennisnissle/2583eba6e2f7ad3efe817d9aaaf91392 to your computer and use it in GitHub Desktop.
Skip automatic invoice creation for suborders
<?php
add_filter( 'storeabill_woo_auto_sync_order_invoices', function( $auto_create, $order_id ) {
if ( $order = wc_get_order( $order_id ) ) {
if ( $order->get_parent_id() > 0 ) {
$auto_create = false;
}
}
return $auto_create;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment