Woo Invoices – option to create invoices for all orders, regardless of payment method/status
Currently Woo Invoices creates invoices only when using the “Pay by Invoice’ method, or when an admin sets the order status to “Invoice”. Perhaps add an option to create invoices for all orders, regardless of the above.
3 Comments. Leave new
I also needed this functionality, this method seems to work:
add_action( ‘woocommerce_thankyou’, ‘create_invoice_for_all_orders’, 10, 1 );
function create_invoice_for_all_orders( $order_id ) {
if ( ! $order_id )
return;
$order = wc_get_order( $order_id );
$method = get_post_meta($order_id, ‘_payment_method’, true);
if ( $method != ‘sliced-invoices’ )
sliced_woocommerce_create_quote_or_invoice(‘invoice’, $order);
}
+1 please.
@David Hay; I suppose that leaves the created invoice in Unpaid status?
Hi, I have a plugin that creates a Sliced invoices invoice with payment when a customer checks out and pays his order in Woocommerce. The invoice is generated as soon as the order is marked “completed” in Woocommerce.
Bit advantage: you get sequential invoice numbers because all invoices are created in Sliced invoices.