How to display item category in admin Orders page WooCommerce

In the WooCommerce -> Orders screen, the product category is not displayed by default; only the product name and cost, Qty, as well as the order details are displayed. I need to show the product category of product in admin Orders page when a customer make a purchase. So let’s have a look

Add below code at the end of your theme’s functions.php file of your active child theme (or theme) and Save the file.

function woocommerce_admin_order_item_column_name(  ) 
{ ?>
  id, 'product_cat' );
  foreach ($termsp as $term) {
   $_categoryid = $term->term_id;
   if( $term = get_term_by( 'id', $_categoryid, 'product_cat' ) ){
   echo $term->name .', ';
  } } ?>
Scroll to Top