Problem with code to only send an email when BACS is the form of payment
-
Hello!
Few months ago, I wanted to make the invoice only be sent to people, when they use BACS as the payment method. I added this code:
/* PDF Predra?un SAMO za BACS */ add_filter( 'wpo_wcpdf_document_is_allowed', function ( $allowed, $document ) { if ( $order = $document->order && $document->type == 'invoice') { // Set the payment method IDs below $payment_methods = ['bacs']; $allowed = ( in_array( $order->get_payment_method(), $payment_methods ) ) ? true : false; } return $allowed; }, 10, 2 );
The code worked, but now, it won’t even generate the document in the PDF Invoices settings in admin dashboard, and it won’t send it to the customer either.
I still want the email to only be sent when BACS is selected. What happened to the code, so it doesn’t work anymore?
Kind regards
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problem with code to only send an email when BACS is the form of payment’ is closed to new replies.