Use of wpo_wcpdf_document_is_allowed on multisite
-
Hello,
I create some orders programmatically by importing data. Some of my data says if we want an invoice or not for that order. I store this data in a custom order meta (wpcf-payeur).
Then, I call your hook
wpo_wcpdf_document_is_allowed
for preventing the invoice creation, in this way :add_filter( 'wpo_wcpdf_document_is_allowed', 'genum_disable_facture_payeur', 30, 2 ); function genum_disable_facture_payeur( $allowed, $document ) { if( $document->exists() && ! empty($order = $document->order) ) { $payeur = $order->get_meta('wpcf-payeur'); if ( $payeur != '') { return false; } else { return $allowed; } } return $allowed; }
For theses orders, there is no invoice in the order, and no invoice number in the orders list, which is fine. We thought that everyting was OK.
BUT now we see that : the invoice PDF does indeed exist in the directory, for example in :
/mymultisite/wp-content/uploads/sites/3/wpo_wcpdf/attachments
and the number of the invoice will be skipped for the next invoice.
The invoice is also attached to some emails…Is it normal ? Is it tied to the fact that we are on multisite ?
How can we prevent any creation of these invoices ?Thanks !
Sylvie
- The topic ‘Use of wpo_wcpdf_document_is_allowed on multisite’ is closed to new replies.