Hi @darrenmaximo,
Try this code snippet to achieve what you want:
/**
* PDF Invoices & Packing Slips for WooCommerce:
* Add the customer ID after the item meta
*/
add_action( 'wpo_wcpdf_after_item_meta', function( $document_type, $item, $order ) {
if( $customer_id = $order->get_customer_id() ) {
echo "<small>Customer ID: {$customer_id}</small>";
}
} , 10, 3 );
If you haven’t worked with code snippets (actions/filters) or functions.php
before, read this guide: How to use filters
Please note that the item hooks are repeated for each product item in the order, therefore, if you have 3 items there, the customer ID will be printed after the item meta within all the item lines
However, if you prefer to add it manually somewhere within your custom PDF template, use this method to get the Customer ID:
$customer_id = $order->get_customer_id();