Stock report

<?php _e('Stock Report'); ?>

‘product’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ => ‘_manage_stock’, ‘value’ => ‘yes’ ) ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘product_type’, ‘field’ => ‘slug’, ‘terms’ => array(‘simple’), ‘operator’ => ‘IN’ ) ) ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>

get_title(); ?> sku; ?> stock; ?>

Variations

‘product_variation’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ => ‘_stock’, ‘value’ => array(”, false, null), ‘compare’ => ‘NOT IN’ ) ) ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); $product = new WC_Product_Variation( $loop->post->ID ); ?>

get_title(); ?> post->post_parent ); ?> sku; ?> stock; ?>