Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Bas Elbers

    (@baaaaas)

    Hi,
    Yes, just set the ‘Attach to Email’ option in General tab to ‘Do not attach’ and manually create and send an invoice. Or use ‘Customer Invoice’, because this email doesn’t get sent automatically.

    You could also add a custom checkout field and add some code to check if a customer wants an invoice.

    Thread Starter leonardodestefanis

    (@leonardodestefanis)

    Ok this is a solution, but is there a way to put a condition before to generate the invoice?

    For example, I’d like if the invoice will be generated by your plugin, only when customer manually select a field called “I want the invoice”.

    Plugin Author Bas Elbers

    (@baaaaas)

    Yes, this is possible. Just add custom checkout field.

    Add below code to check for checkout field in function attach_invoice_to_email on line 352 in file be-woocommerce-pdf-invoices.php.

    $customer_wants_invoice = get_post_meta($order->id, 'i_want_invoice', true);
    if ( ! empty( $customer_wants_invoice ) ) {
    return $attachments;
    }

    add to the beginning of the function. You will loose these changes when you update plugin, so backup changes. Didn’t test the code..

    Plugin Author Bas Elbers

    (@baaaaas)

    Did you get it to work? Please let me know, so I can resolve the topic. ??

    Plugin Author Bas Elbers

    (@baaaaas)

    @leonardodestefanis at least let me know if you got it to work..

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Don't generate invoice for every orders’ is closed to new replies.