[ad_1]
Hi @marcateap:
If this is an item custom meta, you could achieve it with the following code snippet:
/**
* PDF Invoices & Packing Slips for WooCommerce:
* Display item custom fields after the item meta
*/
add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_product_custom_field', 10, 3 );
function wpo_wcpdf_product_custom_field ( $template_type, $item, $order ) {
if ( empty( $item['item'] ) ) return;
// Replace "location" with the actual name
$field_name="location";
$location = $item['item']->get_meta( $field_name ) ?: $item['item']->get_meta( "_$field_name");
if ( ! empty( $location ) ) {
echo '<div class="product-location" style="font-size:7pt;margin-top:-5pt;">Location: ' . $location . '</div>';
}
}Otherwise, if it is a product custom meta, see some examples here: Displaying product custom fields
