由于以下原因,我已经成功创建了一个专栏:
// ADDING COLUMN TITLES
add_filter( \'manage_edit-shop_order_columns\', \'custom_shop_order_column\',11);
function custom_shop_order_column($columns)
{
//add columns
$columns[\'my-column1\'] = __( \'Column Title\',\'theme_slug\');
return $columns;
}
// adding the data for each orders by column (example)
add_action( \'manage_shop_order_posts_custom_column\' , \'custom_orders_list_column_content\', 10, 2 );
function custom_orders_list_column_content( $column )
{
global $post, $woocommerce, $the_order;
$order_id = $the_order->id;
switch ( $column )
{
case \'my-column1\' :
$myVarOne = wc_get_order_item_meta( $order_id, \'_the_meta_key1\', true );
echo $myVarOne;
break;
}
但我不知道如何将数据添加到此列。我需要添加客户购买的物品。有可能吗?
谢谢