Skip to content

Instantly share code, notes, and snippets.

@rynaldos-zz
Created February 16, 2017 11:19
Show Gist options
  • Save rynaldos-zz/35f756a22841c3101e88c981f28fad71 to your computer and use it in GitHub Desktop.
Save rynaldos-zz/35f756a22841c3101e88c981f28fad71 to your computer and use it in GitHub Desktop.
[WooCommerce | Print Invoice & Packing slips] Only send invoice when order is completed
add_filter( 'wc_pip_invoice_email_order_status_change_trigger_actions', 'woo_custom_invoice_status', 10, 2 );
function woo_custom_invoice_status( $actions, $email_class ) {
$actions = array(
'woocommerce_order_status_failed_to_completed_notification',
'woocommerce_order_status_pending_to_completed_notification',
'woocommerce_order_status_processing_to_completed',
);
return $actions;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment