Customize code snippet
-
Hi
I found the following snippet on this forum and it works fine.add_action( 'wpo_wcpdf_after_settings_page', 'wcpdf_invoice_number_store_debug_tools', 9, 2 ); function wcpdf_invoice_number_store_debug_tools( $tab, $section ){ global $wpdb; if ($tab !== 'debug') { return; } $store_name = "invoice_number"; $table_name = "{$wpdb->prefix}wcpdf_{$store_name}"; // i.e. wp_wcpdf_invoice_number $results = $wpdb->get_results( "SELECT * FROM {$table_name}" ); echo "<table>"; echo "<tr><th>invoice number</th><th>order ID</th><th>order date</th></tr>"; foreach ($results as $result) { printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>", $result->id, $result->order_id, $result->date); } echo '</table>';I have two questions:
– how to have separate tables for each month?
– and how to have the invoice numbers as defined in the Documents > Number format settings?I tried many things to customize this code but none worked, my PHP skills are not very good 😉
Can someone help me please? Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Customize code snippet’ is closed to new replies.