• Resolved moberhammer

    (@moberhammer)


    Hi,

    I was using the plugin already some year with success. But since a month the PDF of the bill isn’t generated automatically anymore. I haven’t changed something on my code, I have only updated this plugin to the newest version.

    My orders where payed with paypal IPN and completed alright. Only the bill isnt generated anymore. If I do that then manually the bill will be created alright.

    Have any idea where to search for the error?

    Thanks!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter moberhammer

    (@moberhammer)

    I see that the “wpo_wcpdf_email_attachment” action is never called.

    Plugin Contributor Ewout

    (@pomegranate)

    Is the email sent without the PDF or is the email with the PDF never sent at all? wpo_wcpdf_email_attachment is an action for other plugins to use. By that time, the attachment is already generated and queued in the email attachments.
    Have you checked your PHP error logs? What if you manually (re)send the email with the attachment?

    Thread Starter moberhammer

    (@moberhammer)

    The Email is send, but without the pdf.
    In the apache errorlogs aren’t any errors.

    I use the wpo_wcpdf_email_attachment only to copy the tmp generated pdf to a backuparchive and I see that my function is never called anymore.

    add_action(‘wpo_wcpdf_email_attachment’, ‘woo_save_invoice_pdf’);
    function woo_save_invoice_pdf($pdf_path)
    {
    error_log($pdf_path.’————–save pdf’);
    copy($pdf_path, str_replace(‘tmp’,’archiv’,substr($pdf_path, 0, -4) . ‘.archiv.pdf’));
    }

    I will try to send manually.

    Plugin Contributor Ewout

    (@pomegranate)

    ok, let me know what you find! If the action is never called and you don’t see any errors, it means that the attachment condition wasn’t met somewhere in the process.

    Same here with latest Woocommerce (2.X) and WordPress and 1.6.0.2 of this plugin. Luckily our automated tests noticed it. I debugged it for a while in the IDE but couldn’t pin point the error.

    It doesn’t work with “Once when invoice is created/emailed” but seems to work at least in My account with “only for specific order statuses”. I’m also not seeing the link anymore on the “Order confirmation” page and neither in “My-Account” so presume it is also related to email attachments.

    Thread Starter moberhammer

    (@moberhammer)

    Hi Ewout,

    I tried to “re”send manually with success. The pdf is attached.

    I will put some debugoutput to find out more.

    Plugin Contributor Ewout

    (@pomegranate)

    @jicks83 what you describe appears to refer to the My Account page. If the email not sent as an attachment, then it won’t show on the My Account page unless you create it manually or set the account page button to appear for a specific order status. There could be many reasons for this, so I suggest that you do some further testing.

    @moberhammer – let me know what you find!

    Hello Ewout,

    Same problem here as well. Updated to the latest version the other day.

    When an order is placed by a customer, in Woocommerce Order overview, there is no invoice number shown at all.
    When manually resending email and PDF invoice (with success), the Invoice number is showing up in the overview.

    Kind regards.
    Martijn

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Martijn,
    I don’t think this is the same problem as the above, since this relates to the use of an action hook specifically. An invoice number is only created when an invoice is created. Note that the invoice email is never sent automatically, so it’s possible all you need to do is to attach the PDF invoice to the Processing or Completed order email. See: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/invoice-numbers-explained/

    Hope that helps! If you still have any issues after this, please open an new thread (describing the issue and things you tried), I’ll do my best to help.

    Ewout

    Thread Starter moberhammer

    (@moberhammer)

    Hi Ewout,

    today I had time to test a little bit.
    I have seen, that your function “attach_pdf_to_email” (Filter woocommerce_email_attachments) is only called with the statuses “new_order” and “customer_completed_order”. It is never called with “customer_invoice”, and I have set that only there the invoice will be attached.
    You have any idea why?

    Thanks!
    Martin

    Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    The woocommerce_email_attachments filter is called for all WooCommerce emails, but the customer_invoice is a manual email. If you manually send that email, the attach_pdf_to_email method will be executed (just tested to double check), but the wpo_wcpdf_email_attachment action will only be called if you have attached the invoice to this email.

    Ewout

    Thread Starter moberhammer

    (@moberhammer)

    Oh sorry than I understand my Problem. I thought that the customer_invoice is the one that will be send automatically after payment. So I have to change to customer_completed_order.

    Thanks for your help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘PDF not generated automatically’ is closed to new replies.