Add Below Code in Your Theme function.php
function action_woocommerce_admin_order_item_headers( )
{ ?>
<th class="item sortable" colspan="2" data-sort="string-ins"><?php _e( 'Item category', 'woocommerce' ); ?></th>
<?php
};
// define the woocommerce_admin_order_item_values callback
function action_woocommerce_admin_order_item_values( $_product, $item, $item_id )
{ ?>
<td class="name" colspan="2" >
<?php
$termsp = get_the_terms( $_product->id, 'product_cat' );
if(!empty($termsp)){
foreach ($termsp as $term) {
$_categoryid = $term->term_id;
if( $term = get_term_by( 'id', $_categoryid, 'product_cat' ) ){
echo $term->name .', ';
}
} } ?>
</td>
<?php
};
// add the action
add_action( 'woocommerce_admin_order_item_values', 'action_woocommerce_admin_order_item_values', 10, 3 );
add_action( 'woocommerce_admin_order_item_headers', 'action_woocommerce_admin_order_item_headers', 10, 0 );
Related Posts:
- How to redefine the sorting of product categories by menu_order?
- WooCommerce – How to show specific category first-rest of products-specific category last
- How do order product categories – on a parent category page – in Woocommerce?
- Woocommerce custom taxonomy order
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- Order get_terms() By Custom Field
- Sort posts by tags in category pages
- Programmatically create product category and add thumbnail in woocommerce
- Display all posts in category, with specific tag posts at top
- Create product category and keyword search form in woocommerce? [closed]
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- How do I edit pre_get_post for the category the user is currently in?
- Order posts by category name
- Use get_term_children to get the sub category of a parent category for the current post
- Hide uncategorized products from the shop page
- Remove word “Category” from WooCommerce product page [closed]
- Filtering search results
- WooCommerce change category url and product base
- Output link to category from WP_Query loop of woocommerce products
- How to get product count with respect to categories in WooComerce
- Get woocommerce catogry
- Custom order categories in admin dashboard
- Arrange posts by date in front page
- Set post categories to include parents when setting child category
- Linking products to categories
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- Omit specific product categories from WooCommerce shortcode
- WC 3.x Get categories from variable product of the cart
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Product Category WooCommerce
- Hide woocommerce category name from specific pages
- need to add custom field in more products
- Pagination is not working properly in Product Category/Tag pages
- Best way of getting WooCommerce category path
- How to recreate a copy of a product category in WooCommerce? [closed]
- Get parrent category name
- Sorting category products not working
- Order categories by name or view count
- Woocommerce custom category page with pagination [closed]
- I want to display the all the posts that are inside a certain subcategory
- wp e-commerce group product by category [closed]
- List posts in alphabetical order
- Categories are not listing their respective products
- Display single category name in woocommerce loop
- Building Menu from Woocommerce Product Categories
- woocommerce related products by specific categories [closed]
- How to change the order of the subcategory and category in a post?
- Do not show sub categories in the loop on archive-product.php
- List just subcategory and products of active category page in Woocommerce
- why get_the_post_thumbnail( the_ID()) echos extra post id
- Filter WooCommerce archive pages by an additional category
- Custom tax_query filter not working for Woocommerce product categories
- Woocommerce filter function not updating
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- Woocommerce search form with category select
- Template for product-category page [closed]
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- WooCommerce shared categories
- displaying the last product comment in the woocommerce category
- Displaying Single Product Page Parent and Child Category
- Woocommerce only display child category when parent is checked (on add new product page)
- Conditional label Woocommerce archive [unsolved]
- How can I order all subcategories alphabetical independent of the parent categories?
- Show audio player only in specific post type category
- How to show given products only using product id array from specific category page in woocommerce
- Ordering terms whilst in loop
- How to target all woocommerce categories that don’t have any subcategories in them?
- WooCommerce REST API not returning the default products category
- In if…else condition, the else statement shows even if if statement is correct
- How to show WooCommerce Categories on ‘shop’ page instead of products?
- How can I display all products from all categories on one page with woocommerce?
- How to edit woocommerce sub-category page
- Modifying category order
- Get WooCommerce product category list in functions.php
- Is there a reason to put a product in both the Child and Parent Categories?
- WordPress category title not update in navigation menu
- WooCommerce showing active product categories on single product page
- selecting categories that have products with tag/category
- Restrict retrieved terms by category?
- Woocommerce Category Sort Dropdown
- Woocommerce: all products of all categories instead products of one category
- How to get WooCommerce Product Categories and its children’s children?
- Woocommerce change tag_id to name
- Woocommerce product catalog, products with different description
- set a parent category in a product woocommerce
- No results found for second level category
- How to display products with multiple conditions, product_id and category_id
- Configure query with multiple categories in a custom order?
- How to get related category/categories in WordPress archive page
- $args Orderby The number
- Category menu that filters out empty categories
- woocommerce – products by category slug? [closed]
- How can I add a Categories page link to a menu? [closed]
- WooCommerce category display in custom page
- Sorting Woocommerce products by category and attributes
- Update wordpress menu with woocommerce products
- Get all categories
- Woocommerce Force the category choice before creating new product? [duplicate]
- Function to reference post meta in place of category Woocommerce
- Add custom fields to Woocommerce Category Page