Wordpress woocommerce how to customize the order list, with conditional filtering function, such as signed and pending options;

WooCommerce is the most popular WordPress e-commerce plug-in. The main reason for its popularity is that its rich API and convenient and flexible background management interface bring a lot of convenience to the customized development of WooCommerce. In the management interface of WooCommerce, we can easily check the detailed information of orders placed by users, including the quantity and total amount of goods purchased, which is relatively comprehensive, but there is a very important information that is not displayed by default in WooCommerce, that is, the list of all goods, which is very important and can be displayed through very simple codes.

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