Adding Custom Field to Invoice
-
Hi,
We are using your plugin but just the basic/free version.
We just simply want to add the tax ID number entered by our customer to the invoice.
Can we add it somewhere in the invoice?I saw a code snippet in your website and I tried to edit it but failed.
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_due_date', 10, 2 ); function wpo_wcpdf_due_date ($template_type, $order) { if ($template_type == 'invoice') { // put due date only on invoice $invoice = wcpdf_get_invoice( $order ); if ( $invoice_date = $invoice->get_date() ) { $due_date = date_i18n( get_option( 'date_format' ), strtotime( $invoice_date->date_i18n('Y-m-d H:i:s') . ' + 14 days') ); ?> <tr class="due-date"> <th>Due Date:</th> <td><?php echo $due_date; ?></td> </tr> <?php } } }
Can you please help on how to change this to show the Tax ID instead?
Below is the code which I think get the tax ID:add_action('woocommerce_after_order_notes', 'taxexempt_after_order_notes' ); function taxexempt_after_order_notes( $checkout ) { echo '<div style="clear: both"></div> <h3>Have Tax Exempt/Resale ID?</h3>'; woocommerce_form_field( 'tax_exempt_checkbox', array( 'type' => 'checkbox', 'class' => array('tax-exempt-checkbox'), 'label' => __('Yes (Click Here)'), ), $checkout->get_value( 'tax_exempt_checkbox' )); woocommerce_form_field( 'tax_exempt_id', array( 'type' => 'text', 'class' => array('tax-exempt-id', 'update_totals_on_change'), 'label' => __('Please enter a valid Tax Exempt/Resale ID'), ), $checkout->get_value( 'tax_exempt_id' )); }
Thanks,
-JD
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Adding Custom Field to Invoice’ is closed to new replies.