The plugin generates the invoices when they are needed for the email attachment. If you disable the email attachment they will not be generated automatically and you can manually choose which orders you want to create an invoice for.
If you need to limit the invoices to a specific payment method you’ll have to use a small code snippet (you’ll have to replace bacs
with the internal name/’slug’ of the payment method you want to limit the invoices to):
add_filter('wpo_wcpdf_document_is_allowed','wpo_wcpdf_prevent_on_hold_invoices',10,2);
function wpo_wcpdf_prevent_on_hold_invoices( $is_allowed, $document ) {
if ( !empty($document->order) && $document->get_type() == 'invoice' && $document->order->get_payment_method() != 'bacs' ) {
$is_allowed = false;
}
return $is_allowed;
}
If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters