Print invoice and packing slip for WooCommerce plugin comes with several customisation provisions. You can choose invoice from pre defined templates as well as alter the default appearance.
By default, our plugin handles the entire billing address in single place holder which is [wfte_billing_adddress]. Now if you need to show the customer name only, you can use our custom filter. Insert the below given filter/code snippet into the active theme’s functions.php file.
After adding the code snippet you can use the place holder [wfte_customer_name] anywhere in the template HTML code to include the customer name. To add the place holder go to Invoice > Customize > Code view as shown below.
You can even use the same hook to add any other order meta to invoices and other labels.
Alexis
July 6, 2022
Hi, for filing my taxes it would be useful to have not only the invoice number but also the last name of the buyer in the invoice. for example rather than invoice 0013 – it could be 0013Goertz or something like that. is this possible with some coding?
Mike
July 18, 2022
Hi Alexis,
Thanks for reaching out.
Since it is more personalised customization, kindly raise a support ticket via this link. We’ll answer there.
Mariella escalona
October 30, 2020
Hello, please need help.
We need to put a custom value con invoice pdf (RUT field). We used a hook on another plugin, and need the same solution.
This is the code used on the other plugin on functions.php:
add_action( ‘wpo_wcpdf_after_order_data’, ‘wpo_wcpdf_custom_user_meta’, 10, 2 );
function wpo_wcpdf_custom_user_meta ($template_type, $order) {
$user_id = $order->get_user_id();
if ( !empty($user_id) ) {
$meta_key_billing_company_rut = ‘billing_company_rut’; // change this to your meta key / custom field name
$billing_company_rut = get_user_meta( $user_id, $meta_key_billing_company_rut, true );
$meta_key_billing_rut = ‘billing_rut’; // change this to your meta key / custom field name
$billing_rut = get_user_meta( $user_id, $meta_key_billing_rut, true );
?>
RUT empresa:
RUT persona responsable:
<?php
}
}
Regards
Mark
November 3, 2020
You can add custom meta saved in order details to invoice via the Invoice settings > Advanced settings page > Custom order meta option.
Mariella escalona
November 5, 2020
Didn’t work