Hello zubeldialuis,
There are several different subscription plugins out there, which one are you using?
The most simple way to solve this is to include a small bit of php script at the top of your template to detect whether the order is a subscription renewal and if so, update the invoice number and date. The code would look something like this:
<?php
if ( ... ) { // check for renewal here!
// get template settings for next invoice number
$template_settings = get_option('wpo_wcpdf_template_settings');
// update invoice number:
$invoice_number = $template_settings['next_invoice_number'];
update_post_meta( $wpo_wcpdf->export->order->id, '_wcpdf_invoice_number', $invoice_number );
// update invoice date:
$invoice_date = current_time('mysql');
update_post_meta( $wpo_wcpdf->export->order->id, '_wcpdf_invoice_date', $invoice_date );
// increase next_order_number
$template_settings = get_option('wpo_wcpdf_template_settings');
$template_settings['next_invoice_number'] = $invoice_number+1;
update_option( 'wpo_wcpdf_template_settings', $template_settings );
}
?>
You will have to figure out (or ask the plugin developers) how to do that check in the first line!
This will overwrite the old invoice number in the order. I don’t know how your subscriptions plugin works, if it creates a new subscription order internally that doesn’t have to be an issue.
Ewout