[ad_1]
Hello @agusapri,
Do you by any chance know the meta key under which the barcode is saved in the order? Finding WooCommerce Custom Fields
Is this an order barcode or a product barcode?
Displaying Product custom fields
Displaying Custom fields
It’s Product Barcode.
Please see this screenshot, https://kutabali.my.id/Screenshot.png for Order Post Meta Key (I am not sure how tell you).
Thanks for confirming that it is a product barcode, @agusapri!
Please try adding this code snippet to display the product barcode after the item meta:
/**
* PDF Invoices & Packing Slips for WooCommerce:
* Add the product barcode (number) after the item meta
*/
add_action( 'wpo_wcpdf_after_item_meta', function( $template_type, $item, $order ) {
if ( isset( $item['product'] ) && ! empty( $barcode = $item['product']->get_meta( 'barcode' ) ) ) {
echo "<div class=\"barcode\">Barcode: {$barcode}</div>";
}
} , 10, 3 );If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters
