In order to skip invoice generation based on a payment method, simply add the following action to your themes functions.php
function bewpi_attach_invoice_excluded_payment_methods( $payment_methods ) { return array( 'bacs', 'cod', 'cheque', 'paypal' ); } add_filter( 'bewpi_attach_invoice_excluded_payment_methods', 'bewpi_attach_invoice_excluded_payment_methods', 10, 2 );
Add the name of the payment method in the return array section. This is the second line.