Detect Product Type with code

The is_virtual() method in WC_Product class it return boolean. It means that, if $product->is_virtual() return true, it is virtual product, vice versa if return false, then the product is physical. In your case, you can use this if( $product->is_virtual() ) { //is Virtual Product, do something here } if( !$product->is_virtual() ) { //is Physical Product, … Read more

I want to Display custom woocomerce meta box in orders list

Solved it here is the answer add_action( ‘manage_shop_order_posts_custom_column’, ‘delivery_company_order_column_content’, 10, 2 ); function delivery_company_order_column_content( $column, $post_id ) { if ( $column === ‘delivery_company_order’ ) { $order = wc_get_order( $post_id ); $delivery_company = get_post_meta( $order->get_id(), ‘delivery_company’, true ); $delivery_company_name = get_the_title( $delivery_company ); echo $delivery_company_name; } } add_filter(‘manage_edit-shop_order_columns’, ‘delivery_company_order_column’); function delivery_company_order_column($columns) { $columns[‘delivery_company_order’] = ‘Delivery Company’; … Read more