Hi @svatslav,
What I am missing, but probably only I did not find it, is to use shortcode for last two digits og the year for numbering invoices (shortcode [invoice_year] makes 4 digit year only)
Sorry for not to have an article in our Docs for this yet (I personally will work on that!), but this is already possible, you just need to pass the date format to the placeholder, this way:
[invoice_date="y"]
The placeholder above will return the last 2 digits from the current year, e.g. 22 for 2022.
…and also possibility to reset invoice number each month.
This can be achieved by adding this code snippet to your site:
/**
* Resets number store monthly
*/
add_filter( 'wpo_wcpdf_invoice_number_store_name', function( $number_store_name, $store_base_name, $date, $method, $document ) {
$year = $date->date_i18n( 'Y' );
$month = $date->date_i18n( 'm' );
return "{$store_base_name}_{$month}_{$year}";
}, 10, 5 );
If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters
Thank you very much for the five-stars review!
Thank you very much for reply and tips how to solve my needs with the PDF invoice for Woocommerce at WordPress. As I see, you have not only great plugin for invoices, but also excellent support. [invoice_date=”y”] for 2 digits works fine, if the snipets function will work for me I will see at the 1st day of next month. Thank you again. Have a nice day. 🙂
Hi again @svatslav,
As I mentioned above, I was working a new Docs article explaining how the number format work, that we have published today: Number format explained. I think the Available placeholders may be interesting for you.
Hope it’s helpful!