Add content behind admin order line item meta

There are moments when you need to add content behind the order line items in your woocommerce admin. In my case for example I needed this to show a reference id stored under a product.

You can get the product id from the $item->get_data(); array.

/**
 * Adds content after order item meta
 */
function th_add_content_after_order_itemmeta( $item_id, $item, $product ) {
   $item_data = $item->get_data();
   $product_id = $item['product_id']; // If you need to do something with the data from the product..
   echo 'Content after order itemmeta';
}
add_action( 'woocommerce_after_order_itemmeta', 'th_add_content_after_order_itemmeta', 10, 3 );
Robbert Vermeulen

Need help from a WordPress expert?

I would love to hear about your project and how I can help you achieve your goals