• Resolved growinsane

    (@growinsane)


    Hi is there a straight forward way to ignore certain orders and do nothing with regards to invoicing/pdf generation?
    I use your plugin together with simba cloud printing but some of my orders are essentially amazon fulfilled and so do not need to be printed or have documents go out by email. All these orders have a common email address to filter by.

    Thanks,

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi there!
    This depends your setup with Simba cloud printing, which is outside of the control of this plugin.

    The core plugin only creates an invoice automatically if it is sent as an attachment, which you can filter using the wpo_wcpdf_custom_attachment_condition filter. Here’s an example that filters by email address:

    
    add_filter( 'wpo_wcpdf_custom_attachment_condition', 'wpo_wcpdf_invoice_attachment_condition', 100, 4 );
    function wpo_wcpdf_invoice_attachment_condition( $condition, $order, $status, $template_type ) {
        // only apply condition to invoices
        if ($template_type == 'invoice') {
            // do not attach invoice for specific email
            if ( $order->get_billing_email() == '[email protected]') {
                $condition = false;
            }
        }
    
        return $condition;
    }
    

    Again though, this will probably not affect the invoices created by the simba plugin, I recommend contacting their support to ask if they have a similar filter.

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Filter / Conditional PDF/Invoice generation’ is closed to new replies.