I found the issue myself ๐ I fixed it by moving a line of code in the file includes/class-invoice.php
The parameter $order_number (used on line 59) is not known untill line 77.
Copy line 78 ($order_number = str_replace(“#”, “”, $order->get_order_number());)
Paste on line 57 (inside the if statement)
Excellent! Thank you very much.
Hey ๐
i still have the same problem with the invoice number.
I moved the line to 57. But it doesnt work.
Is this correct?
if($id == $options['email_type'] || $id == $options['attach_to_new_order']){
$order_number = str_replace("#", "", $order->get_order_number());
// Update db with sequential invoice number
$this->set_sequential_invoice_number($order_number);
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Hello,
Yesterday I looked into it and the problem only exists when inserting the invoice number for the first time. So when there isn’t a ‘_bewpi_invoice_number’ option in the db and the plugin creates one and uses the get_invoice_number() function. The plugin won’t receive/return that firstly created option. So I think the problem is the get_invoice_number() function. If you send the invoice for the second time, the function returns the right invoice_number from db.
Tonight I will look into it.
hello thanks for awesome Plugin. I am having the issue addressed in this post. Do I need to amend some code, as suggested above? I am also getting ‘fatal error’ messages after an email has been sent – not every time, just occasionally, next time I will capture the exact error message…
Hello eighty0ne,
I asume that you have got a older version running. Please try to update to latest version. If the error exists, send me the error messages and I will look into it.
hello, thanks for reply. I am using Version 1.1.1 – think this is latest edition?
[Moderator Note: No bumping, thank you.]
I fixed it and will bring shortly a update available.
Hey there,
I’m having the very same problem. Couldn’t fix it with the code above, I actually never managed to understand php properlyโฆ
Any ideas or news?
Thanks,
Jana
Hello baaaaas,
i still have this issue on the plugin..
The number stys at 000…
Hi,
I’m also having this problem (with the latest version of the plugin).
The invoice pdf for the buyer get 0000, but the pdf that get attached to email “New order”, has a correct order numer (0052). I’m at a loss here…
Any fix on its way?
Great plugin, by the way ๐
Thanks!