The following code adds a column of special information to our order preview page, named "purchased goods", and each line of the list will display a commodity name and quantity. Just copy the following code into the functions.php file of the theme or the related file of the plug-in.
add _ filter(' manage _ edit-shop _ order _ columns ',' show_product_order ', 15);
Function show _ product _ order ($ columns) (
//Add a column of information
$columns['product-display'] = __ ('purchased goods');
return $ columns
}
Add the commodity information purchased by the user to this column.
add _ action(' manage _ shop _ order _ posts _ custom _ column ',' snv_custom_shop_order_column ', 10,2);
Function snv _ custom _ shop _ order _ column ($ column) (
global $post,$woocommerce,$ the _ order
Switch ($ column) (
Case "Product-Show":
$te