display WCFF field on backoffice orders page

[ad_1]

Hello guys,
First thank you for this plugin which is very helpfull for me.

I’m a begginer in developping, but I’m trying to display WCFF fields on woocommerce backoffice orders page, to achieve a better reading of what orders contain.

For that, here is the code I work on, which I put in functions.php.
I’m able to display a new column in which I’m able to insert product description for example. But I didn’t find how to get my WCFF fileds to be displayed here.

Here is my code :

<?php
// Add a new custom column to admin order list
add_filter( 'manage_edit-shop_order_columns', 'admin_orders_list_add_column', 10, 1 );
function admin_orders_list_add_column( $columns ){
    $columns['custom_column'] = __( 'New Column', 'woocommerce' );

    return $columns;
}

// The data of the new custom column in admin order list
add_action( 'manage_shop_order_posts_custom_column' , 'admin_orders_list_column_content', 10, 2 );
function admin_orders_list_column_content( $column, $post_id ){
    global $the_order;

    if( 'custom_column' === $column ){
        $count = 0;

        // Loop through order items
        foreach( $the_order->get_items() as $item ) {
            $product = $item->get_product(); // The WC_Product Object
            $style   = $count > 0 ? ' style="padding-left:6px;"' : '';
        	$meta0   = $product->get_meta_data();

            // Display product description, but I want to display my WCFF fields here
        	printf($product->get_description());


            $count++;
        }
    }
}
?>

Can you help me finding how to catch the fields to display them please ?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer