// The filter to actually return the order number for the given order
add_filter('woocommerce_order_number',array(&$this,'get_ordernumber'),10,2/*<= Also get the order object! */);
$this->thirdparty_wpo_wcpdf_init();
}
...
...
@@ -101,8 +103,7 @@ class OpenToolsOrdernumbers {
),
array(
'title'=>$this->helper->__('Use global counter'),
'desc'=>$this->helper->__('A global counter is independent of the number format and will never reset. A non-global counter runs within the number format and will start from the inital value whenever any of the variables used in the format changes (to be precise: a new counter will be used, so it is possible to have multiple counters running in parallel).'),
'desc_tip'=>true,
'desc'=>$this->helper->__('A global counter never resets. Non-global counters run within each number format and reset whenever any variable changes.'),
'id'=>'ordernumber_global',
'type'=>'checkbox',
'default'=>'no',
...
...
@@ -117,6 +118,51 @@ class OpenToolsOrdernumbers {
'desc'=>$this->helper->__('This plugin currently supports modifying the invoice number formats of the following invoicing plugins: <a href="https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/">WooCommerce PDF Invoices & Packing Slips</a>'),
'desc'=>$this->helper->__('Check to use custom invoice numbers rather than the default format of your invoicing plugin.'),
'id'=>'customize_invoice',
'type'=>'checkbox',
'default'=>'no'
),
array(
'title'=>$this->helper->__('Invoice number format'),
'desc'=>$this->helper->__('The format for the invoice numbers (variables can be entered as [...], the counter is indicated by the #). To use a different counter name than displayed, put the custom counter name after a |, e.g. "[year]-[month]/#|[year]" to use the month in the invoice number, but reset the counter only yearly. Advanced settings for the counter can be added as [#####:start/step], e.g. [#:100] to start new counters at 100, or [#/5] to increment the counter by 5. The number of # in the format determine how many digits are shown at least, e.g. [########] will always show at least 8 digits for the counter, e.g. 00000014.'),
'desc_tip'=>true,
'id'=>'invoice_format',
'default'=>'#',
'type'=>'text',
'css'=>'width: 100%',
),
array(
'title'=>$this->helper->__('Use global counter'),
'desc'=>$this->helper->__('A global counter never resets. Non-global counters run within each number format and reset whenever any variable changes.'),
'id'=>'invoice_global',
'type'=>'checkbox',
'default'=>'no',
),
array(
'name'=>$this->helper->__('All invoice number counters'),
'desc'=>$this->helper->__('View and modify the current counter values. The counter value is the value used for the previous number. All changes are immediately applied!'),
$wp_settings_fields['wpo_wcpdf_template_settings']['invoice']['display_number']['args']['description']=$this->helper->__('The <a href="admin.php?page=wc-settings&tab=checkout§ion=ordernumber">Open Tools Ordernumber plugin</a> has invoice numbers enabled and will generate invoice numbers for this plugin.');
$wp_settings_fields['wpo_wcpdf_template_settings']['invoice']['display_number']['args']['description']=$this->helper->__('To let the Open Tools ordernumber plugin create invoice numbers with your desired format, please enable invoices in <a href="admin.php?page=wc-settings&tab=checkout§ion=ordernumber">that plugin\'s configuration page</a>.');