I am looking to add custom meta after the order data in WooCommerce PDF Invoices & Packing Slips. If a Custom Field is present on a WooCommerce order,
In my code my custom field name is wholesale_order
.
For this I make use of:
add_action( 'wpo_wcpdf_after_order_data', 'add_due_date', 10, 2 );
function add_due_date() {
$order_data = get_post_meta( $post->ID, 'wholesale_order', true );
if( $order_data ) {
// Do stuff
}
}
Unfortunately without the desired result, I think the $post->ID
is incorrect and probably the get_post_meta
.
What am I missing?
add_woo_order_data
; are you sure that's the correct hook? – Xhynkwpo_wcpdf_after_order_data
from a PDF Invoice plugin docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/… – neilgee