• Nice plugin. It is great that companies offer free plugins to support WordPress users. I needed to add taxes and add some details to the invoice, but if you know php it is not problem. What I love on this plugin is the possibility to print all invoices at once. 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) and also possibility to reset invoice number each month. Thanks for this plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    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!

    Thread Starter svatslav

    (@svatslav)

    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. ??

    Plugin Contributor Yordan Soares

    (@yordansoares)

    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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PDF invoice’ is closed to new replies.